Function: pixel-scroll-accumulate-velocity
pixel-scroll-accumulate-velocity is a byte-compiled function defined
in pixel-scroll.el.gz.
Signature
(pixel-scroll-accumulate-velocity DELTA)
Documentation
Accumulate DELTA into the current window's kinetic scroll state.
Source Code
;; Defined in /usr/src/emacs/lisp/pixel-scroll.el.gz
(defun pixel-scroll-accumulate-velocity (delta)
"Accumulate DELTA into the current window's kinetic scroll state."
(let* ((state (pixel-scroll-kinetic-state))
(ring (aref state 0))
(time (aref state 1)))
(when (or (and time (> (- (float-time) time) 0.5))
(and (not (ring-empty-p ring))
(not (eq (< delta 0)
(aref state 2)))))
(aset state 0 (make-ring 30)))
(aset state 2 (< delta 0))
(ring-insert (aref state 0)
(cons (aset state 1 (float-time))
delta))))