From: Richard M. Stallman Date: Sat, 30 Apr 1994 07:23:15 +0000 (+0000) Subject: (scroll-bar-event-ratio): New function. X-Git-Tag: emacs-19.34~8631 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8682867842d9cdf5d800cdf306eaaf5a578f96fe;p=emacs.git (scroll-bar-event-ratio): New function. --- diff --git a/lisp/scroll-bar.el b/lisp/scroll-bar.el index 462fdad55ae..181e02999e7 100644 --- a/lisp/scroll-bar.el +++ b/lisp/scroll-bar.el @@ -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,