Made screen drawing a tad faster for long lines.

In preparation for much more major speed-ups with long lines.
This commit is contained in:
Nathan Vegdahl 2015-02-15 20:35:17 -08:00
parent 6eed3fcc74
commit f4a70ba1ad

View File

@ -382,7 +382,9 @@ impl TermUI {
// Loop through the graphemes of the line and print them to // Loop through the graphemes of the line and print them to
// the screen. // the screen.
let mut last_pos_y = 0;
for (g, (pos_y, pos_x), width) in editor.formatter.iter(line) { for (g, (pos_y, pos_x), width) in editor.formatter.iter(line) {
last_pos_y = pos_y;
// Calculate the cell coordinates at which to draw the grapheme // Calculate the cell coordinates at which to draw the grapheme
let px = pos_x as isize + screen_col - editor.view_pos.1 as isize; let px = pos_x as isize + screen_col - editor.view_pos.1 as isize;
let py = pos_y as isize + screen_line; let py = pos_y as isize + screen_line;
@ -433,8 +435,7 @@ impl TermUI {
grapheme_index += 1; grapheme_index += 1;
} }
let (dim_y, _) = editor.formatter.dimensions(line); screen_line += last_pos_y as isize + 1;
screen_line += dim_y as isize;
line_num += 1; line_num += 1;
} }