summaryrefslogtreecommitdiff
path: root/lisp/pixel-scroll.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/pixel-scroll.el')
-rw-r--r--lisp/pixel-scroll.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/lisp/pixel-scroll.el b/lisp/pixel-scroll.el
index 566a0fdb776..dfd9a5ad5b3 100644
--- a/lisp/pixel-scroll.el
+++ b/lisp/pixel-scroll.el
@@ -97,10 +97,11 @@ When scrolling request is delivered soon after the previous one,
user is in hurry. When the time since last scroll is larger than
`pixel-dead-time', we are ready for another smooth scroll, and this
function returns nil."
- (let* ((current-time (float-time))
- (scroll-in-rush-p (< (- current-time pixel-last-scroll-time)
- pixel-dead-time)))
- (setq pixel-last-scroll-time current-time)
+ (let* ((now (current-time))
+ (scroll-in-rush-p (time-less-p
+ (time-subtract now pixel-last-scroll-time)
+ pixel-dead-time)))
+ (setq pixel-last-scroll-time (float-time now))
scroll-in-rush-p))
;;;###autoload