Fix line wrap and scroll
This commit is contained in:
parent
2fbd65a64f
commit
10bf182c5d
1 changed files with 5 additions and 1 deletions
|
|
@ -246,7 +246,11 @@ impl<'b> Iterator for LayoutRunIter<'b> {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
let line_y = self.line_i as f32 * self.buffer.metrics.line_height;
|
let line_y = self
|
||||||
|
.total_layout
|
||||||
|
.saturating_sub(self.buffer.scroll)
|
||||||
|
.saturating_sub(1) as f32
|
||||||
|
* self.buffer.metrics.line_height;
|
||||||
let glyph_height = layout_line.max_ascent + layout_line.max_descent;
|
let glyph_height = layout_line.max_ascent + layout_line.max_descent;
|
||||||
let centering_offset = (self.buffer.metrics.line_height - glyph_height) / 2.0;
|
let centering_offset = (self.buffer.metrics.line_height - glyph_height) / 2.0;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue