Fix LayoutRunIter returning lines beyond Buffer height

This commit is contained in:
Jeremy Soller 2024-07-09 11:21:03 -06:00
parent a03ec6b75f
commit 0e2d050a8d
No known key found for this signature in database
GPG key ID: D02FD439211AF56F

View file

@ -130,7 +130,7 @@ impl<'b> Iterator for LayoutRunIter<'b> {
let centering_offset = (line_height - glyph_height) / 2.0;
let line_y = line_top + centering_offset + layout_line.max_ascent;
if let Some(height) = self.buffer.height_opt {
if line_top + centering_offset > height {
if line_y > height {
return None;
}
}