diff options
| author | Richard M. Stallman | 1994-04-30 07:23:15 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-04-30 07:23:15 +0000 |
| commit | 8682867842d9cdf5d800cdf306eaaf5a578f96fe (patch) | |
| tree | e155d7dcd45c2211d909670497c7d436a555236b | |
| parent | 793da230a15d1b1293a667e569e02480408dd2c7 (diff) | |
| download | emacs-8682867842d9cdf5d800cdf306eaaf5a578f96fe.tar.gz emacs-8682867842d9cdf5d800cdf306eaaf5a578f96fe.zip | |
(scroll-bar-event-ratio): New function.
| -rw-r--r-- | lisp/scroll-bar.el | 7 |
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 @@ | |||
| 34 | 34 | ||
| 35 | ;;;; Utilities. | 35 | ;;;; Utilities. |
| 36 | 36 | ||
| 37 | (defun scroll-bar-event-ratio (event) | ||
| 38 | "Given a scroll bar event EVENT, return the scroll bar position as a ratio. | ||
| 39 | The value is a cons cell (PORTION . WHOLE) containing two integers | ||
| 40 | whose ratio gives the event's vertical position in the scroll bar, with 0 | ||
| 41 | referring to the top and 1 to the bottom." | ||
| 42 | (nth 2 event)) | ||
| 43 | |||
| 37 | (defun scroll-bar-scale (num-denom whole) | 44 | (defun scroll-bar-scale (num-denom whole) |
| 38 | "Given a pair (NUM . DENOM) and WHOLE, return (/ (* NUM WHOLE) DENOM). | 45 | "Given a pair (NUM . DENOM) and WHOLE, return (/ (* NUM WHOLE) DENOM). |
| 39 | This is handy for scaling a position on a scroll bar into real units, | 46 | This is handy for scaling a position on a scroll bar into real units, |