Commit 7beba943 authored by Chong Yidong's avatar Chong Yidong
Browse files

* subr.el (posn-col-row): Properly compute line spacing.

Suggested by Nikolaj Schumacher (Bug#2933).
parent ed8ab760
2009-04-15 Chong Yidong <cyd@stupidchicken.com>
* subr.el (posn-col-row): Properly compute line spacing.
Suggested by Nikolaj Schumacher (Bug#2933).
2009-04-15 Ulf Jasper <ulf.jasper@web.de> 2009-04-15 Ulf Jasper <ulf.jasper@web.de>
   
* net/newst-treeview.el (newsticker-treeview-jump): Enable virtual * net/newst-treeview.el (newsticker-treeview-jump): Enable virtual
......
...@@ -930,13 +930,19 @@ and `event-end' functions." ...@@ -930,13 +930,19 @@ and `event-end' functions."
(cons (scroll-bar-scale pair (window-width window)) 0)) (cons (scroll-bar-scale pair (window-width window)) 0))
(t (t
(let* ((frame (if (framep window) window (window-frame window))) (let* ((frame (if (framep window) window (window-frame window)))
(x (/ (car pair) (frame-char-width frame))) ;; FIXME: This should take line-spacing properties on
(y (/ (cdr pair) (+ (frame-char-height frame) ;; newlines into account.
(or (frame-parameter frame 'line-spacing) (spacing (when (display-graphic-p frame)
;; FIXME: Why the `default'? (or (with-current-buffer (window-buffer window)
(default-value 'line-spacing) line-spacing)
0))))) (frame-parameter frame 'line-spacing)))))
(cons x y)))))) (cond ((floatp spacing)
(setq spacing (truncate (* spacing
(frame-char-height frame)))))
((null spacing)
(setq spacing 0)))
(cons (/ (car pair) (frame-char-width frame))
(/ (cdr pair) (+ (frame-char-height frame) spacing))))))))
(defun posn-actual-col-row (position) (defun posn-actual-col-row (position)
"Return the actual column and row in POSITION, measured in characters. "Return the actual column and row in POSITION, measured in characters.
......
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