diff options
author | Benjamin Otte <otte@redhat.com> | 2010-10-09 11:27:05 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-10-30 01:49:58 +0800 |
commit | 9c9cbddd06100aebe0341bb8b0a632fd5ff5a2b3 (patch) | |
tree | a731d0b97d8306bfebb445feb6f18a092a969a98 /libgnomecanvas/gnome-canvas.c | |
parent | 6b75dd581c0f72f1114bc37afa1d51e9a806df50 (diff) | |
download | gsoc2013-evolution-9c9cbddd06100aebe0341bb8b0a632fd5ff5a2b3.tar.gz gsoc2013-evolution-9c9cbddd06100aebe0341bb8b0a632fd5ff5a2b3.tar.zst gsoc2013-evolution-9c9cbddd06100aebe0341bb8b0a632fd5ff5a2b3.zip |
gnome-canvas: Port GnomeCanvasLine to use Cairo for drawing
Diffstat (limited to 'libgnomecanvas/gnome-canvas.c')
-rw-r--r-- | libgnomecanvas/gnome-canvas.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/libgnomecanvas/gnome-canvas.c b/libgnomecanvas/gnome-canvas.c index 4f84b9e8ab..f89133c9ad 100644 --- a/libgnomecanvas/gnome-canvas.c +++ b/libgnomecanvas/gnome-canvas.c @@ -414,6 +414,18 @@ gnome_canvas_item_update (GnomeCanvasItem *item, item->flags &= ~GNOME_CANVAS_ITEM_NEED_VIS; } +static void +gnome_canvas_matrix_from_affine (cairo_matrix_t *matrix, + double affine[6]) +{ + matrix->xx = affine[0]; + matrix->yx = affine[1]; + matrix->xy = affine[2]; + matrix->yy = affine[3]; + matrix->x0 = affine[4]; + matrix->y0 = affine[5]; +} + #define noHACKISH_AFFINE /* @@ -1106,6 +1118,24 @@ gnome_canvas_item_i2c_affine (GnomeCanvasItem *item, gdouble affine[6]) art_affine_multiply (affine, i2w, w2c); } +/** + * gnome_canvas_item_i2c_matrix: + * @item: A canvas item. + * @matrix: Matrix to take the resulting transformation matrix (return value). + * + * Gets the affine transform that converts from item-relative coordinates to + * canvas pixel coordinates. + **/ +void +gnome_canvas_item_i2c_matrix (GnomeCanvasItem *item, cairo_matrix_t *matrix) +{ + gdouble affine; + + gnome_canvas_item_i2c_affine (item, &affine); + + gnome_canvas_matrix_from_affine (matrix, &affine); +} + /* Returns whether the item is an inferior of or is equal to the parent. */ static gint is_descendant (GnomeCanvasItem *item, GnomeCanvasItem *parent) |