Lazy shaping

This commit is contained in:
Jeremy Soller 2022-10-12 14:23:02 -06:00
parent 2206193fff
commit aed6860568
No known key found for this signature in database
GPG key ID: 87F211AF2BE4C2FE
2 changed files with 30 additions and 15 deletions

View file

@ -128,6 +128,9 @@ fn main() {
let line_height = font_sizes[font_size_i].1 * display_scale;
let window_lines = (window.height() as i32 + line_height - 1) / line_height;
buffer.shape_until(scroll + window_lines);
scroll = cmp::max(0, cmp::min(
buffer.layout_lines().len() as i32 - (window_lines - 1),
scroll