summaryrefslogtreecommitdiff
path: root/gtk/gtktextlayout.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2003-01-21 22:48:33 +0000
committerOwen Taylor <otaylor@src.gnome.org>2003-01-21 22:48:33 +0000
commite435fc1fd16eddc3871ce73d4a00f06e4e9ce914 (patch)
treea8b934c35bd8385f0dca83dbfcf3b8cce441f0bf /gtk/gtktextlayout.c
parent2294c892e70fe8ebce65a51c42340c59c19e1ac4 (diff)
downloadgtk+-e435fc1fd16eddc3871ce73d4a00f06e4e9ce914.tar.gz
Fix off-by-one error on the backward iteration loop, that was causing the
Wed Jan 15 17:02:18 2003 Owen Taylor <otaylor@redhat.com> * 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)
Diffstat (limited to 'gtk/gtktextlayout.c')
-rw-r--r--gtk/gtktextlayout.c5
1 files changed, 3 insertions, 2 deletions
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;
}
}