summaryrefslogtreecommitdiff
path: root/lisp/scroll-bar.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1994-04-30 07:23:15 +0000
committerRichard M. Stallman <rms@gnu.org>1994-04-30 07:23:15 +0000
commitb2354badde27cdaa1e40a8382c50d99b2a56f383 (patch)
tree3711a20b7e43fcfe1211dcd3947ddb5b4b65e1e1 /lisp/scroll-bar.el
parent245ab91d79f8ac1dbba9e14df42cee1273bfb6e0 (diff)
downloademacs-b2354badde27cdaa1e40a8382c50d99b2a56f383.tar.gz
(scroll-bar-event-ratio): New function.
Diffstat (limited to 'lisp/scroll-bar.el')
-rw-r--r--lisp/scroll-bar.el7
1 files changed, 7 insertions, 0 deletions
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,