diff options
author | Benjamin Otte <otte@redhat.com> | 2010-10-15 07:25:40 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-10-30 01:50:00 +0800 |
commit | 24e39b9fb54cad437cc12b24e953be890519d86a (patch) | |
tree | 554da00fae5be782689f20ada6b3259c633663d5 /libgnomecanvas/gnome-canvas-rect.c | |
parent | 9c183ab12ae27089ce972e29aab7000c2edfd466 (diff) | |
download | gsoc2013-evolution-24e39b9fb54cad437cc12b24e953be890519d86a.tar gsoc2013-evolution-24e39b9fb54cad437cc12b24e953be890519d86a.tar.gz gsoc2013-evolution-24e39b9fb54cad437cc12b24e953be890519d86a.tar.bz2 gsoc2013-evolution-24e39b9fb54cad437cc12b24e953be890519d86a.tar.lz gsoc2013-evolution-24e39b9fb54cad437cc12b24e953be890519d86a.tar.xz gsoc2013-evolution-24e39b9fb54cad437cc12b24e953be890519d86a.tar.zst gsoc2013-evolution-24e39b9fb54cad437cc12b24e953be890519d86a.zip |
gnome-canvas: Rewrite GnomeCanvasShape to use Cairo
Dashing properties were commented out in the process. They are not used
inside Evolution.
Diffstat (limited to 'libgnomecanvas/gnome-canvas-rect.c')
-rw-r--r-- | libgnomecanvas/gnome-canvas-rect.c | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/libgnomecanvas/gnome-canvas-rect.c b/libgnomecanvas/gnome-canvas-rect.c index 6e347e36e5..013ce086d5 100644 --- a/libgnomecanvas/gnome-canvas-rect.c +++ b/libgnomecanvas/gnome-canvas-rect.c @@ -38,11 +38,6 @@ #include "gnome-canvas-util.h" #include "gnome-canvas-shape.h" -#include <libart_lgpl/art_vpath.h> -#include <libart_lgpl/art_svp.h> -#include <libart_lgpl/art_svp_vpath.h> -#include <libart_lgpl/art_rgb_svp.h> - /* Base class for rectangle and ellipse item types */ #define noVERBOSE @@ -204,22 +199,23 @@ gnome_canvas_rect_get_property (GObject *object, static void gnome_canvas_rect_update (GnomeCanvasItem *item, gdouble affine[6], ArtSVP *clip_path, gint flags) { - GnomeCanvasRect *rect; - GnomeCanvasPathDef *path_def; - - rect = GNOME_CANVAS_RECT (item); + GnomeCanvasRect *rect = GNOME_CANVAS_RECT (item); if (rect->path_dirty) { - path_def = gnome_canvas_path_def_new (); - - gnome_canvas_path_def_moveto (path_def, rect->x1, rect->y1); - gnome_canvas_path_def_lineto (path_def, rect->x2, rect->y1); - gnome_canvas_path_def_lineto (path_def, rect->x2, rect->y2); - gnome_canvas_path_def_lineto (path_def, rect->x1, rect->y2); - gnome_canvas_path_def_lineto (path_def, rect->x1, rect->y1); - gnome_canvas_path_def_closepath_current (path_def); - gnome_canvas_shape_set_path_def (GNOME_CANVAS_SHAPE (item), path_def); - gnome_canvas_path_def_unref (path_def); + cairo_t *cr; + + cr = gnome_canvas_cairo_create_scratch (); + + cairo_rectangle (cr, + rect->x1, rect->y1, + rect->x2 - rect->x1, + rect->y2 - rect->y1); + + gnome_canvas_shape_set_path (GNOME_CANVAS_SHAPE (item), + cairo_copy_path (cr)); + + cairo_destroy (cr); + rect->path_dirty = 0; } |