1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-24 07:20:37 +00:00

(scroll-bar-event-ratio): New function.

This commit is contained in:
Richard M. Stallman 1994-04-30 07:23:15 +00:00
parent 793da230a1
commit 8682867842

View File

@ -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,