DRYer
This commit is contained in:
@@ -1541,7 +1541,7 @@ screen_update_cell_data(Screen *self, void *address, FONTS_DATA_HANDLE fonts_dat
|
|||||||
lnum = y - self->scrolled_by;
|
lnum = y - self->scrolled_by;
|
||||||
linebuf_init_line(self->linebuf, lnum);
|
linebuf_init_line(self->linebuf, lnum);
|
||||||
if (self->linebuf->line->has_dirty_text ||
|
if (self->linebuf->line->has_dirty_text ||
|
||||||
(cursor_has_moved && (self->cursor->y == lnum || self->last_rendered_cursor_y == lnum))) {
|
(cursor_has_moved && (self->cursor->y == lnum || self->last_rendered.cursor_y == lnum))) {
|
||||||
render_line(fonts_data, self->linebuf->line, lnum, self->cursor, self->disable_ligatures);
|
render_line(fonts_data, self->linebuf->line, lnum, self->cursor, self->disable_ligatures);
|
||||||
if (self->linebuf->line->has_dirty_text && screen_has_marker(self)) mark_text_in_line(self->marker, self->linebuf->line);
|
if (self->linebuf->line->has_dirty_text && screen_has_marker(self)) mark_text_in_line(self->marker, self->linebuf->line);
|
||||||
|
|
||||||
|
|||||||
@@ -76,7 +76,6 @@ typedef struct {
|
|||||||
PyObject_HEAD
|
PyObject_HEAD
|
||||||
|
|
||||||
unsigned int columns, lines, margin_top, margin_bottom, charset, scrolled_by, last_selection_scrolled_by;
|
unsigned int columns, lines, margin_top, margin_bottom, charset, scrolled_by, last_selection_scrolled_by;
|
||||||
unsigned int last_rendered_cursor_x, last_rendered_cursor_y;
|
|
||||||
double pending_scroll_pixels;
|
double pending_scroll_pixels;
|
||||||
CellPixelSize cell_size;
|
CellPixelSize cell_size;
|
||||||
OverlayLine overlay_line;
|
OverlayLine overlay_line;
|
||||||
@@ -86,6 +85,7 @@ typedef struct {
|
|||||||
Selection selection, url_range;
|
Selection selection, url_range;
|
||||||
struct {
|
struct {
|
||||||
IterationData selection, url;
|
IterationData selection, url;
|
||||||
|
unsigned int cursor_x, cursor_y;
|
||||||
} last_rendered;
|
} last_rendered;
|
||||||
bool use_latin1, selection_updated_once, is_dirty, scroll_changed, reload_all_gpu_data;
|
bool use_latin1, selection_updated_once, is_dirty, scroll_changed, reload_all_gpu_data;
|
||||||
Cursor *cursor;
|
Cursor *cursor;
|
||||||
|
|||||||
@@ -315,8 +315,8 @@ cell_prepare_to_render(ssize_t vao_idx, ssize_t gvao_idx, Screen *screen, GLfloa
|
|||||||
|
|
||||||
ensure_sprite_map(fonts_data);
|
ensure_sprite_map(fonts_data);
|
||||||
|
|
||||||
bool cursor_pos_changed = screen->cursor->x != screen->last_rendered_cursor_x
|
bool cursor_pos_changed = screen->cursor->x != screen->last_rendered.cursor_x
|
||||||
|| screen->cursor->y != screen->last_rendered_cursor_y;
|
|| screen->cursor->y != screen->last_rendered.cursor_y;
|
||||||
bool disable_ligatures = screen->disable_ligatures == DISABLE_LIGATURES_CURSOR;
|
bool disable_ligatures = screen->disable_ligatures == DISABLE_LIGATURES_CURSOR;
|
||||||
|
|
||||||
if (screen->reload_all_gpu_data || screen->scroll_changed || screen->is_dirty || (disable_ligatures && cursor_pos_changed)) {
|
if (screen->reload_all_gpu_data || screen->scroll_changed || screen->is_dirty || (disable_ligatures && cursor_pos_changed)) {
|
||||||
@@ -328,8 +328,8 @@ cell_prepare_to_render(ssize_t vao_idx, ssize_t gvao_idx, Screen *screen, GLfloa
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (cursor_pos_changed) {
|
if (cursor_pos_changed) {
|
||||||
screen->last_rendered_cursor_x = screen->cursor->x;
|
screen->last_rendered.cursor_x = screen->cursor->x;
|
||||||
screen->last_rendered_cursor_y = screen->cursor->y;
|
screen->last_rendered.cursor_y = screen->cursor->y;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (screen->reload_all_gpu_data || screen_is_selection_dirty(screen)) {
|
if (screen->reload_all_gpu_data || screen_is_selection_dirty(screen)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user