From e435fc1fd16eddc3871ce73d4a00f06e4e9ce914 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Tue, 21 Jan 2003 22:48:33 +0000 Subject: [PATCH] Fix off-by-one error on the backward iteration loop, that was causing the Wed Jan 15 17:02:18 2003 Owen Taylor * gtk/gtktextlayout.c (gtk_text_layout_validate_yrange): Fix off-by-one error on the backward iteration loop, that was causing the wrong range to be redrawn. (at least part of #72734) --- ChangeLog | 7 +++++++ ChangeLog.pre-2-10 | 7 +++++++ ChangeLog.pre-2-4 | 7 +++++++ ChangeLog.pre-2-6 | 7 +++++++ ChangeLog.pre-2-8 | 7 +++++++ gtk/gtktextlayout.c | 5 +++-- 6 files changed, 38 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8d7bc995f6..ad17fa9dbf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Wed Jan 15 17:02:18 2003 Owen Taylor + + * gtk/gtktextlayout.c (gtk_text_layout_validate_yrange): + Fix off-by-one error on the backward iteration loop, + that was causing the wrong range to be redrawn. + (at least part of #72734) + 2003-01-21 Matthias Clasen * gtk/gtktextview.c (gtk_text_view_size_allocate): Adjust the diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 8d7bc995f6..ad17fa9dbf 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,10 @@ +Wed Jan 15 17:02:18 2003 Owen Taylor + + * gtk/gtktextlayout.c (gtk_text_layout_validate_yrange): + Fix off-by-one error on the backward iteration loop, + that was causing the wrong range to be redrawn. + (at least part of #72734) + 2003-01-21 Matthias Clasen * gtk/gtktextview.c (gtk_text_view_size_allocate): Adjust the diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 8d7bc995f6..ad17fa9dbf 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,10 @@ +Wed Jan 15 17:02:18 2003 Owen Taylor + + * gtk/gtktextlayout.c (gtk_text_layout_validate_yrange): + Fix off-by-one error on the backward iteration loop, + that was causing the wrong range to be redrawn. + (at least part of #72734) + 2003-01-21 Matthias Clasen * gtk/gtktextview.c (gtk_text_view_size_allocate): Adjust the diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 8d7bc995f6..ad17fa9dbf 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,10 @@ +Wed Jan 15 17:02:18 2003 Owen Taylor + + * gtk/gtktextlayout.c (gtk_text_layout_validate_yrange): + Fix off-by-one error on the backward iteration loop, + that was causing the wrong range to be redrawn. + (at least part of #72734) + 2003-01-21 Matthias Clasen * gtk/gtktextview.c (gtk_text_view_size_allocate): Adjust the diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 8d7bc995f6..ad17fa9dbf 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,10 @@ +Wed Jan 15 17:02:18 2003 Owen Taylor + + * gtk/gtktextlayout.c (gtk_text_layout_validate_yrange): + Fix off-by-one error on the backward iteration loop, + that was causing the wrong range to be redrawn. + (at least part of #72734) + 2003-01-21 Matthias Clasen * gtk/gtktextview.c (gtk_text_view_size_allocate): Adjust the diff --git a/gtk/gtktextlayout.c b/gtk/gtktextlayout.c index ddfcc7fad8..b5cdae7422 100644 --- a/gtk/gtktextlayout.c +++ b/gtk/gtktextlayout.c @@ -812,6 +812,7 @@ gtk_text_layout_validate_yrange (GtkTextLayout *layout, /* Validate backwards from the anchor line to y0 */ line = _gtk_text_iter_get_text_line (anchor); + line = _gtk_text_line_previous (line); seen = 0; while (line && seen < -y0) { @@ -827,11 +828,11 @@ gtk_text_layout_validate_yrange (GtkTextLayout *layout, delta_height += line_data->height - old_height; first_line = line; - first_line_y = -seen; + first_line_y = -seen - line_data->height; if (!last_line) { last_line = line; - last_line_y = -seen + line_data->height; + last_line_y = -seen; } }