(scroll-bar-event-ratio): New function.
authorRichard M. Stallman <rms@gnu.org>
Sat, 30 Apr 1994 07:23:15 +0000 (07:23 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sat, 30 Apr 1994 07:23:15 +0000 (07:23 +0000)
lisp/scroll-bar.el

index 462fdad..181e029 100644 (file)
 \f
 ;;;; 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,