emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 6c17cdc: Fix 1-off errors in pixel scrolling code


From: Po Lu
Subject: master 6c17cdc: Fix 1-off errors in pixel scrolling code
Date: Tue, 30 Nov 2021 07:46:06 -0500 (EST)

branch: master
commit 6c17cdc1dc04697398811d96e40a9a3ad07bbd3f
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Fix 1-off errors in pixel scrolling code
    
    * lisp/pixel-scroll.el (pixel-scroll-precision-scroll-down): Fix
    one-off errors.
---
 lisp/pixel-scroll.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisp/pixel-scroll.el b/lisp/pixel-scroll.el
index 097e4e5..cc90be0 100644
--- a/lisp/pixel-scroll.el
+++ b/lisp/pixel-scroll.el
@@ -424,15 +424,15 @@ the height of the current window."
 (defun pixel-scroll-precision-scroll-up (delta)
   "Scroll the current window up by DELTA pixels."
   (let* ((edges (window-edges nil t nil t))
-         (max-y (- (nth 3 edges)
+         (max-y (- (nth 3 edges) 1
                    (window-tab-line-height)
                    (window-header-line-height)))
          (usable-height (- max-y (nth 1 edges))))
     (when-let* ((posn (posn-at-point))
                (current-y (+ (cdr (posn-x-y posn))
                              (line-pixel-height))))
-      (while (and (< (- max-y current-y) delta)
-                  (< (cdr (posn-object-width-height posn))
+      (while (and (<= (- max-y current-y) delta)
+                  (<= (cdr (posn-object-width-height posn))
                      usable-height))
         (vertical-motion -1)
         (setq current-y (- current-y (line-pixel-height))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]