summaryrefslogtreecommitdiff
path: root/lisp/scroll-bar.el
diff options
context:
space:
mode:
authorMartin Rudalics <rudalics@gmx.at>2014-08-28 08:46:58 +0200
committerMartin Rudalics <rudalics@gmx.at>2014-08-28 08:46:58 +0200
commita7ef7a0e53ae1f391f4bda207bb5e9b9d833d354 (patch)
tree47c95273a03b30fdcc7f5c4e3224a6fe298668a0 /lisp/scroll-bar.el
parentf1fdf67b4e87cf5974fa4e445b23fef1d10bb7cb (diff)
downloademacs-a7ef7a0e53ae1f391f4bda207bb5e9b9d833d354.tar.gz
Some fixes for scroll bar code.
* w32term.c (w32_horizontal_scroll_bar_handle_click): In `event->y' return entire range (the size of the scroll bar minus that of the thumb). * xterm.c (xm_scroll_callback, xaw_jump_callback): In `whole' return entire range (the scaled size of the scroll bar minus that of the slider). In `portion' return the scaled position of the slider. (xaw_jump_callback): Restore part of code for vertical scroll bar broken in change from 2014-07-27. (xaw_scroll_callback): Provide incremental scrolling with horizontal scroll bars. (x_scroll_bar_handle_click): Fix typo introduced in change from 2014-07-27. * scroll-bar.el (scroll-bar-horizontal-drag-1): Handle new interpretation of `portion-whole'.
Diffstat (limited to 'lisp/scroll-bar.el')
-rw-r--r--lisp/scroll-bar.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/scroll-bar.el b/lisp/scroll-bar.el
index f803eb7f928..2dd394fa2af 100644
--- a/lisp/scroll-bar.el
+++ b/lisp/scroll-bar.el
@@ -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.