textview: fix off-by-one in y_range invalidation
authorChristian Hergert <chergert@redhat.com>
Wed, 9 Oct 2019 17:43:34 +0000 (10:43 -0700)
committerChristian Hergert <chergert@redhat.com>
Wed, 9 Oct 2019 17:43:34 +0000 (10:43 -0700)
Previously, with selection bounds, we could have a state where a line
display with selections set would eroniously stay in the cache. This
aggresively releases those at the boundary cases fixing deselection
drawing state.

gtk/gtktextlinedisplaycache.c

index c15d8907d6cc6ff51f013c0605662dbc1324e4db..b6295b6f5509859e185c62cfed773c2aa1442ab0 100644 (file)
@@ -681,7 +681,7 @@ gtk_text_line_display_cache_invalidate_y_range (GtkTextLineDisplayCache *cache,
       cache_y = _gtk_text_btree_find_line_top (btree, display->line, layout);
       cache_height = display->height;
 
-      if (cache_y + cache_height > y && cache_y < y + old_height)
+      if (cache_y + cache_height >= y && cache_y <= y + old_height)
         {
           gtk_text_line_display_cache_invalidate_display (cache, display, cursors_only);