]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix pixel scrolling over lines with different sized glyphs
authorPo Lu <luangruo@yahoo.com>
Thu, 9 Dec 2021 09:40:08 +0000 (17:40 +0800)
committerPo Lu <luangruo@yahoo.com>
Thu, 9 Dec 2021 09:40:08 +0000 (17:40 +0800)
* lisp/pixel-scroll.el
(pixel-scroll-precision-scroll-down-page): Calculate desired
vscroll with `window-text-pixel-size'.

lisp/pixel-scroll.el

index f21cdaed3d5843d552f16d7fa32b4b0d360d787d..66aa480b70853c442acb0861abc06ed3c4184b87 100644 (file)
@@ -436,7 +436,10 @@ the height of the current window."
                                        (window-header-line-height))))
          (object (posn-object desired-pos))
         (desired-start (posn-point desired-pos))
-        (desired-vscroll (cdr (posn-object-x-y desired-pos)))
+         (scroll-area-total-height (cdr (window-text-pixel-size nil
+                                                                (window-start)
+                                                                (1- desired-start))))
+        (desired-vscroll (- delta scroll-area-total-height))
          (edges (window-edges nil t))
          (usable-height (- (nth 3 edges)
                            (nth 1 edges)))