diff options
| author | Marc Jeanmougin <marc@jeanmougin.fr> | 2019-06-20 13:08:43 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <marc@jeanmougin.fr> | 2019-06-20 13:08:43 +0000 |
| commit | a6538efd22aae68fae6dca99748f13981e547922 (patch) | |
| tree | 6765cbf522a7ef884483dc8c8ed29117f8a9e9a3 /src/ui/dialog | |
| parent | Remove unused code. (diff) | |
| parent | Refactoring: replace funcs with methods. (diff) | |
| download | inkscape-a6538efd22aae68fae6dca99748f13981e547922.tar.gz inkscape-a6538efd22aae68fae6dca99748f13981e547922.zip | |
Merge branch 'refactoring' of gitlab.com:shlomif/inkscape
Diffstat (limited to 'src/ui/dialog')
| -rw-r--r-- | src/ui/dialog/align-and-distribute.cpp | 14 | ||||
| -rw-r--r-- | src/ui/dialog/polar-arrange-tab.cpp | 2 | ||||
| -rw-r--r-- | src/ui/dialog/transformation.cpp | 12 |
3 files changed, 14 insertions, 14 deletions
diff --git a/src/ui/dialog/align-and-distribute.cpp b/src/ui/dialog/align-and-distribute.cpp index a714b96f6..135584932 100644 --- a/src/ui/dialog/align-and-distribute.cpp +++ b/src/ui/dialog/align-and-distribute.cpp @@ -201,7 +201,7 @@ void ActionAlign::do_action(SPDesktop *desktop, int index) a.sy0 * b->min()[Geom::Y] + a.sy1 * b->max()[Geom::Y]); Geom::Point const mp_rel( mp - sp ); if (LInfty(mp_rel) > 1e-9) { - sp_item_move_rel(item, Geom::Translate(mp_rel)); + item->move_rel(Geom::Translate(mp_rel)); changed = true; } } @@ -359,7 +359,7 @@ private : if (!Geom::are_near(pos, it->bbox.min()[_orientation], 1e-6)) { Geom::Point t(0.0, 0.0); t[_orientation] = pos - it->bbox.min()[_orientation]; - sp_item_move_rel(it->item, Geom::Translate(t)); + it->item->move_rel(Geom::Translate(t)); changed = true; } pos += it->bbox[_orientation].extent(); @@ -384,7 +384,7 @@ private : Geom::Point t(0.0, 0.0); t[_orientation] = pos - it.anchor; //translate - sp_item_move_rel(it.item, Geom::Translate(t)); + it.item->move_rel(Geom::Translate(t)); changed = true; } } @@ -626,7 +626,7 @@ private : { Geom::Point p2 = item->getCenter(); Geom::Point delta = p1 - p2; - sp_item_move_rel(item,Geom::Translate(delta[Geom::X],delta[Geom::Y] )); + item->move_rel(Geom::Translate(delta[Geom::X],delta[Geom::Y] )); p1 = p2; } @@ -729,7 +729,7 @@ private : g_random_double_range (0, (*_dialog.randomize_bbox)[Geom::Y].extent() - (*item_box)[Geom::Y].extent()); // displacement is the new center minus old: Geom::Point t = Geom::Point (x, y) - 0.5*(item_box->max() + item_box->min()); - sp_item_move_rel(item, Geom::Translate(t)); + item->move_rel(Geom::Translate(t)); } } @@ -825,7 +825,7 @@ private : Geom::Point base = sorted[i]._base; Geom::Point t(0.0, 0.0); t[_orientation] = b_min[_orientation] + step * i - base[_orientation]; - sp_item_move_rel(item, Geom::Translate(t)); + item->move_rel(Geom::Translate(t)); changed = true; } @@ -888,7 +888,7 @@ private : Geom::Point base = *pt * (item)->i2dt_affine(); Geom::Point t(0.0, 0.0); t[_orientation] = ref_point[_orientation] - base[_orientation]; - sp_item_move_rel(item, Geom::Translate(t)); + item->move_rel(Geom::Translate(t)); changed = true; } } diff --git a/src/ui/dialog/polar-arrange-tab.cpp b/src/ui/dialog/polar-arrange-tab.cpp index 7a64b91c6..98f3bf2aa 100644 --- a/src/ui/dialog/polar-arrange-tab.cpp +++ b/src/ui/dialog/polar-arrange-tab.cpp @@ -260,7 +260,7 @@ static Geom::Point getAnchorPoint(int anchor, SPItem *item) */ static void moveToPoint(int anchor, SPItem *item, Geom::Point p) { - sp_item_move_rel(item, Geom::Translate(p - getAnchorPoint(anchor, item))); + item->move_rel(Geom::Translate(p - getAnchorPoint(anchor, item))); } void PolarArrangeTab::arrange() diff --git a/src/ui/dialog/transformation.cpp b/src/ui/dialog/transformation.cpp index ac6d134e0..a2fa77dfc 100644 --- a/src/ui/dialog/transformation.cpp +++ b/src/ui/dialog/transformation.cpp @@ -682,7 +682,7 @@ void Transformation::applyPageMove(Inkscape::Selection *selection) it < sorted.end(); ++it ) { - sp_item_move_rel(it->item, Geom::Translate(move, 0)); + it->item->move_rel(Geom::Translate(move, 0)); // move each next object by x relative to previous move += x; } @@ -704,7 +704,7 @@ void Transformation::applyPageMove(Inkscape::Selection *selection) it < sorted.end(); ++it ) { - sp_item_move_rel(it->item, Geom::Translate(0, move)); + it->item->move_rel(Geom::Translate(0, move)); // move each next object by x relative to previous move += y; } @@ -797,7 +797,7 @@ void Transformation::applyPageRotate(Inkscape::Selection *selection) auto tmp= selection->items(); for(auto i=tmp.begin();i!=tmp.end();++i){ SPItem *item = *i; - sp_item_rotate_rel(item, Geom::Rotate (angle*M_PI/180.0)); + item->rotate_rel(Geom::Rotate (angle*M_PI/180.0)); } } else { boost::optional<Geom::Point> center = selection->center(); @@ -826,7 +826,7 @@ void Transformation::applyPageSkew(Inkscape::Selection *selection) getDesktop()->getMessageStack()->flash(Inkscape::WARNING_MESSAGE, _("Transform matrix is singular, <b>not used</b>.")); return; } - sp_item_skew_rel (item, 0.01*skewX, 0.01*skewY); + item->skew_rel(0.01*skewX, 0.01*skewY); } else if (_units_skew.isRadial()) { //deg or rad double angleX = _scalar_skew_horizontal.getValue("rad"); double angleY = _scalar_skew_vertical.getValue("rad"); @@ -841,7 +841,7 @@ void Transformation::applyPageSkew(Inkscape::Selection *selection) double skewY = tan(angleY); skewX *= getDesktop()->yaxisdir(); skewY *= getDesktop()->yaxisdir(); - sp_item_skew_rel (item, skewX, skewY); + item->skew_rel(skewX, skewY); } else { // absolute displacement double skewX = _scalar_skew_horizontal.getValue("px"); double skewY = _scalar_skew_vertical.getValue("px"); @@ -854,7 +854,7 @@ void Transformation::applyPageSkew(Inkscape::Selection *selection) getDesktop()->getMessageStack()->flash(Inkscape::WARNING_MESSAGE, _("Transform matrix is singular, <b>not used</b>.")); return; } - sp_item_skew_rel (item, skewX/height, skewY/width); + item->skew_rel(skewX/height, skewY/width); } } } |
