diff options
author | José Aliste <jaliste@src.gnome.org> | 2010-10-03 12:14:48 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2010-10-03 12:30:30 +0200 |
commit | 846f774642c06c88358ef3c4c8174d180caf1be2 (patch) | |
tree | 9d9220e8f638247fd6fa47fa9a2d6eb411ef3e28 /gtk/gtktextdisplay.c | |
parent | c4705377f4ab9e8ca1c2f8c9d70bffa0678cf88a (diff) | |
download | gtk+-846f774642c06c88358ef3c4c8174d180caf1be2.tar.gz |
textview: Fix clip usage
The previous code used cairo_clip_extents() and interpreted its
parameters wrong.
https://bugzilla.gnome.org/show_bug.cgi?id=631203
Diffstat (limited to 'gtk/gtktextdisplay.c')
-rw-r--r-- | gtk/gtktextdisplay.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gtk/gtktextdisplay.c b/gtk/gtktextdisplay.c index 93be053064..782ee14bb1 100644 --- a/gtk/gtktextdisplay.c +++ b/gtk/gtktextdisplay.c @@ -810,16 +810,17 @@ gtk_text_layout_draw (GtkTextLayout *layout, GSList *line_list; GSList *tmp_list; GList *tmp_widgets; - double x, y, width, height; + GdkRectangle clip; g_return_if_fail (GTK_IS_TEXT_LAYOUT (layout)); g_return_if_fail (layout->default_style != NULL); g_return_if_fail (layout->buffer != NULL); g_return_if_fail (cr != NULL); - cairo_clip_extents (cr, &x, &y, &width, &height); + if (!gdk_cairo_get_clip_rectangle (cr, &clip)) + return; - line_list = gtk_text_layout_get_lines (layout, y, y + height, ¤t_y); + line_list = gtk_text_layout_get_lines (layout, clip.y, clip.y + clip.height, ¤t_y); if (line_list == NULL) return; /* nothing on the screen */ |