[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Correct way to implement `pixel-point-and-height-at-unseen-line'?

From: Po Lu
Subject: Correct way to implement `pixel-point-and-height-at-unseen-line'?
Date: Mon, 13 Dec 2021 09:38:30 +0800

I don't know how to make `pixel-point-and-height-at-unseen-line' work
correctly: if I use `line-pixel-height', it will only report the height
the first individual line inside a display string if there is one above
window start, but if I use `window-text-pixel-size', I have to determine
the region to measure, which is quite troublesome.

For example, window start is often not the beginning of a visual line in
Info buffers, so in order to measure the height of the previous line (or
object), I have to find the beginning of the visual line at window
start, and pass that as the `to' argument to window-text-pixel-size

This works okay until there is a `line-prefix' property at window start:
in this case, window start is the beginning of a visual line, but it
does not display at the beginning of the line, which means
`window-text-pixel-size' will add the height of the current line to that
of the previous line.  I will add a workaround to pixel-scroll.el, but
there must be a cleaner way to implement this.

Thanks in advance.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]