]> code.delx.au - gnu-emacs/blobdiff - lisp/scroll-bar.el
Some fixes for scroll bar code.
[gnu-emacs] / lisp / scroll-bar.el
index f803eb7f9289b5fe02fb467835748c0f1ee3aa13..2dd394fa2af6cfbbb71f44c23d2fbd82f42ec21f 100644 (file)
@@ -330,9 +330,11 @@ If you click outside the slider, the window scrolls to bring the slider there."
     (if (eq (current-bidi-paragraph-direction (window-buffer window))
            'left-to-right)
        (set-window-hscroll
-        window (/ (1- (+ (car portion-whole) unit)) unit))
+        window (/ (+ (car portion-whole) (1- unit)) unit))
       (set-window-hscroll
-        window (/ (1- (+ (cdr portion-whole) unit)) unit)))))
+       window (/ (+ (- (cdr portion-whole) (car portion-whole))
+                   (1- unit))
+                unit)))))
 
 (defun scroll-bar-horizontal-drag (event)
   "Scroll the window horizontally by dragging the scroll bar slider.