Eli Zaretskii writes: > > There's already such a calculation in window_scroll_pixel_based: > > /* See if point is on a partially visible line at the end. */ > if (it.what == IT_EOB) > partial_p = it.current_y + it.ascent + it.descent > it.last_visible_y; > else > { > move_it_by_lines (&it, 1); > partial_p = it.current_y > it.last_visible_y; > } > > (This is preceded by moving the iterator to the point's screen line or > to EOB, whichever comes first.) The value it.current_y is the Y > coordinate of the top edge of a glyph row (the value is zero for the > first screen line), so if it.last_visible_y is farther away from that > than the height of the glyph row, that glyph row is fully visible; > otherwise it isn't. I'm not entirely clear why there is a branch in that code. I came up with this; it works, though I'm not sure if it's the best way: