]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix bug#70856
authorPo Lu <luangruo@yahoo.com>
Fri, 10 May 2024 03:01:29 +0000 (11:01 +0800)
committerEshel Yaron <me@eshelyaron.com>
Fri, 10 May 2024 13:40:43 +0000 (15:40 +0200)
* lisp/pixel-scroll.el (pixel-scroll-precision-scroll-down)
(pixel-scroll-precision-scroll-up): Apply finer threshold for
the minimum unit of scrolling.
(pixel-scroll-precision-scroll-down-page): Document true
restrictions on DELTA.  (bug#70856)

(cherry picked from commit 671c9e08b2286d8c32ac6ca00eadc4c8d5e1d5e4)

lisp/pixel-scroll.el

index 4bf912e54c0ac65afb63680056ae5129924ff757..20c7f3fe59608e1949a5262a3330cb6e90dcd7bd 100644 (file)
@@ -501,8 +501,8 @@ Otherwise, redisplay will reset the window's vscroll."
 ;;;###autoload
 (defun pixel-scroll-precision-scroll-down-page (delta)
   "Scroll the current window down by DELTA pixels.
-Note that this function doesn't work if DELTA is larger than
-the height of the current window."
+Note that this function doesn't work if DELTA is larger than or
+equal to the height of the current window."
   (let* ((desired-pos (posn-at-x-y 0 (+ delta
                                        (window-tab-line-height)
                                        (window-header-line-height))))
@@ -551,8 +551,7 @@ the height of the current window."
 
 (defun pixel-scroll-precision-scroll-down (delta)
   "Scroll the current window down by DELTA pixels."
-  (let ((max-height (- (window-text-height nil t)
-                       (frame-char-height))))
+  (let ((max-height (1- (window-text-height nil t))))
     (while (> delta max-height)
       (pixel-scroll-precision-scroll-down-page max-height)
       (setq delta (- delta max-height)))
@@ -666,8 +665,7 @@ to `pixel-scroll-precision-interpolation-factor'."
 
 (defun pixel-scroll-precision-scroll-up (delta)
   "Scroll the current window up by DELTA pixels."
-  (let ((max-height (- (window-text-height nil t)
-                       (frame-char-height))))
+  (let ((max-height (window-text-height nil t)))
     (when (> max-height 0)
       (while (> delta max-height)
         (pixel-scroll-precision-scroll-up-page max-height)