From 07d95325e4bb955c4b660f632c77c4693374282f Mon Sep 17 00:00:00 2001 From: Po Lu Date: Thu, 9 Dec 2021 17:40:08 +0800 Subject: [PATCH] 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'. --- lisp/pixel-scroll.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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))) -- 2.39.2