Changeset 3934

Show
Ignore:
Timestamp:
10/28/05 17:50:37 (3 years ago)
Author:
horiguti
Message:

* mw32scroll.el (w32-scroll-bar-drag): Avoid arithmetic error when
start dragging at the end of the buffer. Refine scrolling around the
end of the buffer.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lisp/ChangeLog.Meadow

    r3933 r3934  
     12005-10-28  Kyotaro HORIGUCHI  <horiguti@meadowy.org> 
     2 
     3        * mw32scroll.el (w32-scroll-bar-drag): Avoid arithmetic error when 
     4        start dragging at the end of the buffer. 
     5 
    162005-10-28  Hideyuki SHIRAI  <shirai@meadowy.org> 
    27 
  • trunk/lisp/mw32scroll.el

    r3913 r3934  
    4646         (scrollbar-epoch (car (nth 2 (nth 1 event)))) 
    4747         (scrollbar-pagesize (nth 2 (mw32-get-scroll-bar-info window))) 
     48         (scrollbar-ceil 
     49          (- (1+ (cdr (nth 2 (nth 1 event)))) scrollbar-pagesize)) 
    4850         (echo-keystrokes 0) 
    4951         done line col pos scrollbar-offset start-position 
     
    5355    (if (zerop scrollbar-epoch) 
    5456        (setq scrollbar-epoch 1)) 
     57 
     58    (if (>= scrollbar-epoch scrollbar-ceil) 
     59        (setq scrollbar-epoch (1- scrollbar-ceil))) 
    5560 
    5661    (save-selected-window 
     
    6469      (setq buffer-epoch (window-start)) 
    6570      (setq buffer-scroll-limit 
    66             (save-excursion (goto-char (point-max)) 
    67                             (recenter -1) 
    68                             (window-start))) 
     71            (max (save-excursion (goto-char (point-max)) 
     72                                 (recenter -1) 
     73                                 (window-start)) 
     74                 buffer-epoch)) 
    6975      (set-window-start window buffer-epoch) 
    7076      (setq lower-ratio (/ (float (- buffer-epoch (point-min))) 
    7177                           scrollbar-epoch)) 
    7278      (setq upper-ratio (/ (float (- buffer-scroll-limit buffer-epoch)) 
    73                            (- (cdr (nth 2 (nth 1 event))) 
    74                               scrollbar-pagesize 
    75                               scrollbar-epoch))) 
     79                           (- scrollbar-ceil scrollbar-epoch))) 
    7680      (while (not done) 
    7781        (setq event (read-event))