Commit 86828678 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

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

parent 793da230
......@@ -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,
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment