From 65b1049d7028a3394961f6d4fe4418e6cdef6053 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 27 Oct 2010 15:52:34 -0400 Subject: Fix gnome_canvas_item_w2i_matrix(). Was returning an inverted matrix: i2w instead of w2i. --- libgnomecanvas/gnome-canvas.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'libgnomecanvas') diff --git a/libgnomecanvas/gnome-canvas.c b/libgnomecanvas/gnome-canvas.c index 92cd664a96..26d853e8a4 100644 --- a/libgnomecanvas/gnome-canvas.c +++ b/libgnomecanvas/gnome-canvas.c @@ -923,15 +923,14 @@ gnome_canvas_item_i2w_matrix (GnomeCanvasItem *item, cairo_matrix_t *matrix) void gnome_canvas_item_w2i_matrix (GnomeCanvasItem *item, cairo_matrix_t *matrix) { + cairo_status_t status; + g_return_if_fail (GNOME_IS_CANVAS_ITEM (item)); g_return_if_fail (matrix != NULL); - cairo_matrix_init_identity (matrix); - - while (item) { - cairo_matrix_multiply (matrix, &item->matrix, matrix); - item = item->parent; - } + gnome_canvas_item_i2w_matrix (item, matrix); + status = cairo_matrix_invert (matrix); + g_return_if_fail (status == CAIRO_STATUS_SUCCESS); } /** -- cgit