From 8867de5daf309e4cdd3fce177b408618490be4f3 Mon Sep 17 00:00:00 2001 From: Abhishek Sharma Public Date: Tue, 29 Jun 2010 23:35:42 +0530 Subject: This is the first c++ification commit from me. It handles sp-line, sp-polyline, sp-item and marks the onset of document c++ification as well. Users can check performace increase with [/usr/bin/time -v inkscape_binary_with_commandline_options]. (bzr r9546.1.1) --- src/unclump.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/unclump.cpp') diff --git a/src/unclump.cpp b/src/unclump.cpp index 85306698c..1d051bc62 100644 --- a/src/unclump.cpp +++ b/src/unclump.cpp @@ -31,7 +31,7 @@ unclump_center (SPItem *item) return i->second; } - Geom::OptRect r = item->getBounds(sp_item_i2d_affine(item)); + Geom::OptRect r = item->getBounds(item->i2d_affine()); if (r) { Geom::Point const c = r->midpoint(); c_cache[item->getId()] = c; @@ -50,7 +50,7 @@ unclump_wh (SPItem *item) if ( i != wh_cache.end() ) { wh = i->second; } else { - Geom::OptRect r = item->getBounds(sp_item_i2d_affine(item)); + Geom::OptRect r = item->getBounds(item->i2d_affine()); if (r) { wh = r->dimensions(); wh_cache[item->getId()] = wh; @@ -294,8 +294,8 @@ unclump_push (SPItem *from, SPItem *what, double dist) //g_print ("push %s at %g,%g from %g,%g by %g,%g, dist %g\n", SP_OBJECT_ID(what), it[Geom::X],it[Geom::Y], p[Geom::X],p[Geom::Y], by[Geom::X],by[Geom::Y], dist); - sp_item_set_i2d_affine(what, sp_item_i2d_affine(what) * move); - sp_item_write_transform(what, SP_OBJECT_REPR(what), what->transform, NULL); + what->set_i2d_affine(what->i2d_affine() * move); + what->doWriteTransform(SP_OBJECT_REPR(what), what->transform, NULL); } /** @@ -317,8 +317,8 @@ unclump_pull (SPItem *to, SPItem *what, double dist) //g_print ("pull %s at %g,%g to %g,%g by %g,%g, dist %g\n", SP_OBJECT_ID(what), it[Geom::X],it[Geom::Y], p[Geom::X],p[Geom::Y], by[Geom::X],by[Geom::Y], dist); - sp_item_set_i2d_affine(what, sp_item_i2d_affine(what) * move); - sp_item_write_transform(what, SP_OBJECT_REPR(what), what->transform, NULL); + what->set_i2d_affine(what->i2d_affine() * move); + what->doWriteTransform(SP_OBJECT_REPR(what), what->transform, NULL); } -- cgit v1.2.3