[nautilus] editable-label: fix cairo drawing regressions
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] editable-label: fix cairo drawing regressions
- Date: Fri, 8 Oct 2010 15:21:58 +0000 (UTC)
commit 407666719856127547f5c2f3f03f6a050858239a
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Wed Oct 6 17:36:58 2010 +0200
editable-label: fix cairo drawing regressions
eel/eel-editable-label.c | 15 +++++++++------
1 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/eel/eel-editable-label.c b/eel/eel-editable-label.c
index 6215912..531a223 100644
--- a/eel/eel-editable-label.c
+++ b/eel/eel-editable-label.c
@@ -1458,19 +1458,22 @@ eel_editable_label_draw_cursor (EelEditableLabel *label, cairo_t *cr, gint xoff
gtk_draw_insertion_cursor (widget, cr,
&cursor_location,
- FALSE, dir1, TRUE);
+ FALSE, dir2, TRUE);
}
}
else /* Block cursor */
{
cairo_region_t *clip;
+ cairo_save (cr);
+
cairo_set_source_rgb (cr, 0, 0, 0);
cairo_rectangle (cr,
xoffset + PANGO_PIXELS (strong_pos.x),
yoffset + PANGO_PIXELS (strong_pos.y),
PANGO_PIXELS (strong_pos.width),
PANGO_PIXELS (strong_pos.height));
+ cairo_fill (cr);
if (!block_at_line_end)
{
@@ -1480,11 +1483,6 @@ eel_editable_label_draw_cursor (EelEditableLabel *label, cairo_t *cr, gint xoff
gdk_cairo_region (cr, clip);
cairo_clip (cr);
-
- /* FIXME should use gtk_paint, but it can't use a clip
- * region
- */
-
gdk_cairo_set_source_color (cr,
>k_widget_get_style (widget)->base[GTK_STATE_NORMAL]);
cairo_move_to (cr, xoffset, yoffset);
@@ -1492,6 +1490,8 @@ eel_editable_label_draw_cursor (EelEditableLabel *label, cairo_t *cr, gint xoff
cairo_region_destroy (clip);
}
+
+ cairo_restore (cr);
}
}
}
@@ -1555,6 +1555,8 @@ eel_editable_label_draw (GtkWidget *widget,
x, y,
range,
1);
+ cairo_save (cr);
+
gdk_cairo_region (cr, clip);
cairo_clip (cr);
@@ -1569,6 +1571,7 @@ eel_editable_label_draw (GtkWidget *widget,
cairo_move_to (cr, x, y);
pango_cairo_show_layout (cr, label->layout);
+ cairo_restore (cr);
cairo_region_destroy (clip);
}
else if (gtk_widget_has_focus (widget))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]