From: Po Lu Date: Thu, 9 Dec 2021 09:40:08 +0000 (+0800) Subject: Fix pixel scrolling over lines with different sized glyphs X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~16^2~4046^2~6 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=07d95325e4bb955c4b660f632c77c4693374282f;p=emacs.git Fix pixel scrolling over lines with different sized glyphs * lisp/pixel-scroll.el (pixel-scroll-precision-scroll-down-page): Calculate desired vscroll with `window-text-pixel-size'. --- diff --git a/lisp/pixel-scroll.el b/lisp/pixel-scroll.el index f21cdaed3d5..66aa480b708 100644 --- a/lisp/pixel-scroll.el +++ b/lisp/pixel-scroll.el @@ -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)))