From bb1252bdb33c2ccb765fd3dc4cb94e508f13a0c6 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Thu, 9 Dec 2021 11:11:26 +0800 Subject: [PATCH] Allow customizing step between each interpolated scroll * lisp/pixel-scroll.el (pixel-scroll-precision-interpolate): Use new option. (pixel-scroll-precision-interpolation-between-scroll): New user option. --- lisp/pixel-scroll.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/pixel-scroll.el b/lisp/pixel-scroll.el index 94c14d50dca..2bef8ca5b0e 100644 --- a/lisp/pixel-scroll.el +++ b/lisp/pixel-scroll.el @@ -153,6 +153,12 @@ Nil means to not interpolate such scrolls." :type 'float :version "29.1") +(defcustom pixel-scroll-precision-interpolation-between-scroll 0.001 + "The number of seconds between each step of an interpolated scroll." + :group 'mouse + :type 'float + :version "29.1") + (defun pixel-scroll-in-rush-p () "Return non-nil if next scroll should be non-smooth. When scrolling request is delivered soon after the previous one, @@ -546,7 +552,7 @@ animation." (factor pixel-scroll-precision-interpolation-factor) (last-time (float-time)) (time-elapsed 0.0) - (between-scroll 0.001) + (between-scroll pixel-scroll-precision-interpolation-between-scroll) (rem (window-parameter nil 'interpolated-scroll-remainder)) (time (window-parameter nil 'interpolated-scroll-remainder-time))) (when (and rem time -- 2.39.2