aboutsummaryrefslogtreecommitdiffstats
path: root/libgnomecanvas/gnome-canvas-rect.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-11-09 21:41:52 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-06-30 00:41:26 +0800
commita7788ff36828762193cf64b72909bb23ef0fe4d0 (patch)
tree82b2683e0ee2555e55d158742396319a6c722a04 /libgnomecanvas/gnome-canvas-rect.c
parenta19689605aa9ab9fcb1ac59c60e7c2236ea64457 (diff)
downloadgsoc2013-evolution-a7788ff36828762193cf64b72909bb23ef0fe4d0.tar
gsoc2013-evolution-a7788ff36828762193cf64b72909bb23ef0fe4d0.tar.gz
gsoc2013-evolution-a7788ff36828762193cf64b72909bb23ef0fe4d0.tar.bz2
gsoc2013-evolution-a7788ff36828762193cf64b72909bb23ef0fe4d0.tar.lz
gsoc2013-evolution-a7788ff36828762193cf64b72909bb23ef0fe4d0.tar.xz
gsoc2013-evolution-a7788ff36828762193cf64b72909bb23ef0fe4d0.tar.zst
gsoc2013-evolution-a7788ff36828762193cf64b72909bb23ef0fe4d0.zip
Adapt GnomeCanvas to latest gtk+-3.0 API.
Diffstat (limited to 'libgnomecanvas/gnome-canvas-rect.c')
-rw-r--r--libgnomecanvas/gnome-canvas-rect.c37
1 files changed, 22 insertions, 15 deletions
diff --git a/libgnomecanvas/gnome-canvas-rect.c b/libgnomecanvas/gnome-canvas-rect.c
index 1e44aa850e..853992e254 100644
--- a/libgnomecanvas/gnome-canvas-rect.c
+++ b/libgnomecanvas/gnome-canvas-rect.c
@@ -392,7 +392,7 @@ gnome_canvas_rect_update (GnomeCanvasItem *item,
static void
gnome_canvas_rect_draw (GnomeCanvasItem *item,
- GdkDrawable *drawable,
+ cairo_t *cr,
gint x,
gint y,
gint width,
@@ -400,28 +400,35 @@ gnome_canvas_rect_draw (GnomeCanvasItem *item,
{
GnomeCanvasRect *rect;
cairo_matrix_t matrix;
- cairo_t *cr;
rect = GNOME_CANVAS_RECT (item);
- cr = gdk_cairo_create (drawable);
+
+ cairo_save (cr);
gnome_canvas_item_i2c_matrix (item, &matrix);
cairo_transform (cr, &matrix);
- cairo_rectangle (
- cr,
- rect->priv->x1 - x,
- rect->priv->y1 - y,
- rect->priv->x2 - rect->priv->x1,
- rect->priv->y2 - rect->priv->y1);
-
- if (gnome_canvas_rect_setup_for_fill (rect, cr))
- cairo_fill_preserve (cr);
+ if (gnome_canvas_rect_setup_for_fill (rect, cr)) {
+ cairo_rectangle (
+ cr,
+ rect->priv->x1 - x,
+ rect->priv->y1 - y,
+ rect->priv->x2 - rect->priv->x1,
+ rect->priv->y2 - rect->priv->y1);
+ cairo_fill (cr);
+ }
- if (gnome_canvas_rect_setup_for_stroke (rect, cr))
- cairo_stroke_preserve (cr);
+ if (gnome_canvas_rect_setup_for_stroke (rect, cr)) {
+ cairo_rectangle (
+ cr,
+ rect->priv->x1 - x,
+ rect->priv->y1 - y,
+ rect->priv->x2 - rect->priv->x1,
+ rect->priv->y2 - rect->priv->y1);
+ cairo_stroke (cr);
+ }
- cairo_destroy (cr);
+ cairo_restore (cr);
}
static GnomeCanvasItem *