Clip based on ascent and descent, not baseline (#396)
Due to https://github.com/pop-os/cosmic-text/pull/141 the LayoutRunIter incorrect checks to see if the baseline is past the visible bounds of the buffer, instead of using the maximum ascent and maximum descent from the baseline.
This commit is contained in:
parent
bcfb05a390
commit
3b1aa511d1
1 changed files with 2 additions and 2 deletions
|
|
@ -131,12 +131,12 @@ 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_y > height {
|
||||
if line_y - layout_line.max_ascent > height {
|
||||
return None;
|
||||
}
|
||||
}
|
||||
self.line_top += line_height;
|
||||
if line_y < 0.0 {
|
||||
if line_y + layout_line.max_descent < 0.0 {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue