summaryrefslogtreecommitdiff
path: root/gtk/gtkcellrenderer.c
diff options
context:
space:
mode:
Diffstat (limited to 'gtk/gtkcellrenderer.c')
-rw-r--r--gtk/gtkcellrenderer.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/gtk/gtkcellrenderer.c b/gtk/gtkcellrenderer.c
index ae478a4663..804e50b6bf 100644
--- a/gtk/gtkcellrenderer.c
+++ b/gtk/gtkcellrenderer.c
@@ -641,30 +641,32 @@ gtk_cell_renderer_render (GtkCellRenderer *cell,
{
gboolean selected = FALSE;
GtkCellRendererPrivate *priv = cell->priv;
+ cairo_t *cr;
g_return_if_fail (GTK_IS_CELL_RENDERER (cell));
g_return_if_fail (GTK_CELL_RENDERER_GET_CLASS (cell)->render != NULL);
selected = (flags & GTK_CELL_RENDERER_SELECTED) == GTK_CELL_RENDERER_SELECTED;
+ cr = gdk_cairo_create (window);
+ gdk_cairo_rectangle (cr, expose_area);
+ cairo_clip (cr);
+
if (priv->cell_background_set && !selected)
{
- cairo_t *cr = gdk_cairo_create (window);
-
gdk_cairo_rectangle (cr, background_area);
gdk_cairo_set_source_color (cr, &priv->cell_background);
cairo_fill (cr);
-
- cairo_destroy (cr);
}
GTK_CELL_RENDERER_GET_CLASS (cell)->render (cell,
- window,
+ cr,
widget,
- (GdkRectangle *) background_area,
- (GdkRectangle *) cell_area,
- (GdkRectangle *) expose_area,
+ background_area,
+ cell_area,
flags);
+
+ cairo_destroy (cr);
}
/**