From: Christian Hergert Date: Wed, 9 Oct 2019 17:43:34 +0000 (-0700) Subject: textview: fix off-by-one in y_range invalidation X-Git-Tag: archive/raspbian/4.4.1+ds1-2+rpi1^2~18^2~20^2~757^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=e4a00f864d845398e77bdeafdffd7f98b1d4cc3b;p=gtk4.git textview: fix off-by-one in y_range invalidation 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. --- diff --git a/gtk/gtktextlinedisplaycache.c b/gtk/gtktextlinedisplaycache.c index c15d8907d6..b6295b6f55 100644 --- a/gtk/gtktextlinedisplaycache.c +++ b/gtk/gtktextlinedisplaycache.c @@ -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);