summaryrefslogtreecommitdiff
path: root/lisp/scroll-bar.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1993-06-05 20:58:47 +0000
committerRichard M. Stallman <rms@gnu.org>1993-06-05 20:58:47 +0000
commitd2ae6f7e7aef2682bdb6f5af9295898d9209339c (patch)
treef2f7d4308c5be7104dc025a0eb6442c6685d5294 /lisp/scroll-bar.el
parent016494d277e08df62d885a7506eab7bd24a12c13 (diff)
downloademacs-d2ae6f7e7aef2682bdb6f5af9295898d9209339c.tar.gz
(scroll-bar-drag-1):
Calculate position relative to the accessible part of the buffer.
Diffstat (limited to 'lisp/scroll-bar.el')
-rw-r--r--lisp/scroll-bar.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/scroll-bar.el b/lisp/scroll-bar.el
index cddce3e419c..fa7e4a6d3ec 100644
--- a/lisp/scroll-bar.el
+++ b/lisp/scroll-bar.el
@@ -103,7 +103,10 @@ EVENT should be a scroll bar click or drag event."
(portion-whole (nth 2 start-position)))
(save-excursion
(set-buffer (window-buffer window))
- (goto-char (scroll-bar-scale portion-whole (buffer-size)))
+ ;; Calculate position relative to the accessible part of the buffer.
+ (goto-char (+ (point-min)
+ (scroll-bar-scale portion-whole
+ (- (point-max) (point-min)))))
(beginning-of-line)
(set-window-start window (point)))))