Commit 846f7746 authored by José Aliste's avatar José Aliste Committed by Benjamin Otte

textview: Fix clip usage

The previous code used cairo_clip_extents() and interpreted its
parameters wrong.
parent c4705377
......@@ -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))
line_list = gtk_text_layout_get_lines (layout, y, y + height, &current_y);
line_list = gtk_text_layout_get_lines (layout, clip.y, clip.y + clip.height, &current_y);
if (line_list == NULL)
return; /* nothing on the screen */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment