forked from AuroraMiddleware/gtk
textlinedisplaycache: short-circuit y_range invalidation
If we have a y==-1 then we are generally invalidating the whole textview. For this case, we can just discard the entire GtkTextLineDisplay cache. Fixes #2975
This commit is contained in:
parent
7fe7d5ab4f
commit
94d17a6809
@ -663,6 +663,12 @@ gtk_text_line_display_cache_invalidate_y_range (GtkTextLineDisplayCache *cache,
|
||||
|
||||
STAT_INC (cache->inval_by_y_range);
|
||||
|
||||
if (y < 0)
|
||||
{
|
||||
gtk_text_line_display_cache_invalidate (cache);
|
||||
return;
|
||||
}
|
||||
|
||||
btree = _gtk_text_buffer_get_btree (layout->buffer);
|
||||
iter = find_iter_at_at_y (cache, layout, y);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user