From dd99498088eab1e915c2cd740cb636841aae2ce4 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Sat, 23 Mar 2002 22:14:40 +0000 Subject: invalidate the line containing start, even if the [start,end) range is 2002-03-23 Havoc Pennington * gtk/gtktextlayout.c (gtk_text_layout_real_invalidate): invalidate the line containing start, even if the [start,end) range is empty (just invalidate [start,end], essentially). Partially fixes #72374 --- gtk/gtktextlayout.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'gtk/gtktextlayout.c') diff --git a/gtk/gtktextlayout.c b/gtk/gtktextlayout.c index b92e85cc8f..71b585ac87 100644 --- a/gtk/gtktextlayout.c +++ b/gtk/gtktextlayout.c @@ -700,6 +700,13 @@ gtk_text_layout_real_invalidate (GtkTextLayout *layout, g_return_if_fail (GTK_IS_TEXT_LAYOUT (layout)); g_return_if_fail (layout->wrap_loop_count == 0); + /* Because we may be invalidating a mark, it's entirely possible + * that gtk_text_iter_equal (start, end) in which case we + * should still invalidate the line they are both on. i.e. + * we always invalidate the line with "start" even + * if there's an empty range. + */ + #if 0 gtk_text_view_index_spew (start_index, "invalidate start"); gtk_text_view_index_spew (end_index, "invalidate end"); @@ -712,8 +719,7 @@ gtk_text_layout_real_invalidate (GtkTextLayout *layout, { GtkTextLineData *line_data = _gtk_text_line_get_data (line, layout); - if (line_data && - (line != last_line || !gtk_text_iter_starts_line (end))) + if (line_data) { gtk_text_layout_invalidate_cache (layout, line); _gtk_text_line_invalidate_wrap (line, line_data); -- cgit v1.2.1