[gtk+] textview: Fix clip usage
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] textview: Fix clip usage
- Date: Sun, 3 Oct 2010 10:34:18 +0000 (UTC)
commit 846f774642c06c88358ef3c4c8174d180caf1be2
Author: José Aliste <jaliste src gnome org>
Date: Sun Oct 3 12:14:48 2010 +0200
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
gtk/gtktextdisplay.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtktextdisplay.c b/gtk/gtktextdisplay.c
index 93be053..782ee14 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 */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]