# HG changeset patch # User Richard M. Stallman # Date 767690595 0 # Node ID 3dae5675cd3ecc02b496b7fa870258520653d0e1 # Parent a2c7acc3be9cca663769084fb34ab4d8bd34c5f9 (scroll-bar-event-ratio): New function. diff -r a2c7acc3be9c -r 3dae5675cd3e lisp/scroll-bar.el --- a/lisp/scroll-bar.el Sat Apr 30 07:00:37 1994 +0000 +++ b/lisp/scroll-bar.el Sat Apr 30 07:23:15 1994 +0000 @@ -34,6 +34,13 @@ ;;;; Utilities. +(defun scroll-bar-event-ratio (event) + "Given a scroll bar event EVENT, return the scroll bar position as a ratio. +The value is a cons cell (PORTION . WHOLE) containing two integers +whose ratio gives the event's vertical position in the scroll bar, with 0 +referring to the top and 1 to the bottom." + (nth 2 event)) + (defun scroll-bar-scale (num-denom whole) "Given a pair (NUM . DENOM) and WHOLE, return (/ (* NUM WHOLE) DENOM). This is handy for scaling a position on a scroll bar into real units,