[gtk/wip/chergert/textview-fix-selection] textview: fix off-by-one in y_range invalidation
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/chergert/textview-fix-selection] textview: fix off-by-one in y_range invalidation
- Date: Wed, 9 Oct 2019 17:44:12 +0000 (UTC)
commit e4a00f864d845398e77bdeafdffd7f98b1d4cc3b
Author: Christian Hergert <chergert redhat com>
Date: Wed Oct 9 10:43:34 2019 -0700
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.
gtk/gtktextlinedisplaycache.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]