aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Paul Wallington2003-03-10 13:25:42 +0000
committerJohn Paul Wallington2003-03-10 13:25:42 +0000
commit3a24cce05be3b93d612490953a216b7bbddf87ac (patch)
tree4f79700dc4591c164f340ea25408ad84ce5a0a49
parentb84d224e6b65cc8db632a629b2aa906cf5260af1 (diff)
downloademacs-3a24cce05be3b93d612490953a216b7bbddf87ac.tar.gz
emacs-3a24cce05be3b93d612490953a216b7bbddf87ac.zip
(posn-col-row): Take into account `line-spacing'.
-rw-r--r--lisp/subr.el9
1 files changed, 6 insertions, 3 deletions
diff --git a/lisp/subr.el b/lisp/subr.el
index 39240b601ec..29afbecb1e5 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -655,8 +655,11 @@ POSITION should be a list of the form
655as returned by the `event-start' and `event-end' functions. 655as returned by the `event-start' and `event-end' functions.
656For a scroll-bar event, the result column is 0, and the row 656For a scroll-bar event, the result column is 0, and the row
657corresponds to the vertical position of the click in the scroll bar." 657corresponds to the vertical position of the click in the scroll bar."
658 (let ((pair (nth 2 position)) 658 (let* ((pair (nth 2 position))
659 (window (posn-window position))) 659 (window (posn-window position))
660 (vspacing (or (buffer-local-value 'line-spacing
661 (window-buffer window))
662 0)))
660 (if (eq (if (consp (nth 1 position)) 663 (if (eq (if (consp (nth 1 position))
661 (car (nth 1 position)) 664 (car (nth 1 position))
662 (nth 1 position)) 665 (nth 1 position))
@@ -669,7 +672,7 @@ corresponds to the vertical position of the click in the scroll bar."
669 (cons (scroll-bar-scale pair (window-width window)) 0) 672 (cons (scroll-bar-scale pair (window-width window)) 0)
670 (let* ((frame (if (framep window) window (window-frame window))) 673 (let* ((frame (if (framep window) window (window-frame window)))
671 (x (/ (car pair) (frame-char-width frame))) 674 (x (/ (car pair) (frame-char-width frame)))
672 (y (/ (cdr pair) (frame-char-height frame)))) 675 (y (/ (cdr pair) (+ (frame-char-height frame) vspacing))))
673 (cons x y)))))) 676 (cons x y))))))
674 677
675(defsubst posn-timestamp (position) 678(defsubst posn-timestamp (position)