From 2f5eb047d9e05be5e68549ef6b75070d2faa7d2f Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Sat, 11 Oct 2008 11:16:23 -0400 Subject: Merging from trunk (bzr r6884) --- src/sp-image.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src/sp-image.cpp') diff --git a/src/sp-image.cpp b/src/sp-image.cpp index a3112bd03..57f8804d9 100644 --- a/src/sp-image.cpp +++ b/src/sp-image.cpp @@ -76,7 +76,7 @@ static void sp_image_print (SPItem * item, SPPrintContext *ctx); static gchar * sp_image_description (SPItem * item); static void sp_image_snappoints(SPItem const *item, SnapPointsIter p); static NRArenaItem *sp_image_show (SPItem *item, NRArena *arena, unsigned int key, unsigned int flags); -static NR::Matrix sp_image_set_transform (SPItem *item, NR::Matrix const &xform); +static Geom::Matrix sp_image_set_transform (SPItem *item, Geom::Matrix const &xform); static void sp_image_set_curve(SPImage *image); @@ -1327,41 +1327,41 @@ static void sp_image_snappoints(SPItem const *item, SnapPointsIter p) * Transform x, y, set x, y, clear translation */ -static NR::Matrix -sp_image_set_transform(SPItem *item, NR::Matrix const &xform) +static Geom::Matrix +sp_image_set_transform(SPItem *item, Geom::Matrix const &xform) { SPImage *image = SP_IMAGE(item); /* Calculate position in parent coords. */ - NR::Point pos( NR::Point(image->x.computed, image->y.computed) * xform ); + Geom::Point pos( Geom::Point(image->x.computed, image->y.computed) * xform ); /* This function takes care of translation and scaling, we return whatever parts we can't handle. */ - NR::Matrix ret(NR::transform(xform)); - NR::Point const scale(hypot(ret[0], ret[1]), + Geom::Matrix ret(Geom::Matrix(xform).without_translation()); + Geom::Point const scale(hypot(ret[0], ret[1]), hypot(ret[2], ret[3])); if ( scale[NR::X] > 1e-9 ) { - ret[0] /= scale[NR::X]; - ret[1] /= scale[NR::X]; + ret[0] /= scale[Geom::X]; + ret[1] /= scale[Geom::X]; } else { ret[0] = 1.0; ret[1] = 0.0; } if ( scale[NR::Y] > 1e-9 ) { - ret[2] /= scale[NR::Y]; - ret[3] /= scale[NR::Y]; + ret[2] /= scale[Geom::Y]; + ret[3] /= scale[Geom::Y]; } else { ret[2] = 0.0; ret[3] = 1.0; } - image->width = image->width.computed * scale[NR::X]; - image->height = image->height.computed * scale[NR::Y]; + image->width = image->width.computed * scale[Geom::X]; + image->height = image->height.computed * scale[Geom::Y]; /* Find position in item coords */ pos = pos * ret.inverse(); - image->x = pos[NR::X]; - image->y = pos[NR::Y]; + image->x = pos[Geom::X]; + image->y = pos[Geom::Y]; item->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); -- cgit v1.2.3