diff options
| author | Maximilian Albert <maximilian.albert@gmail.com> | 2008-09-18 17:42:51 +0000 |
|---|---|---|
| committer | cilix42 <cilix42@users.sourceforge.net> | 2008-09-18 17:42:51 +0000 |
| commit | 1ae6235112448547c758dd643a9ddd267a6cd580 (patch) | |
| tree | 2bb449941d10f4b71629a75d741465429e0ebfa0 /src/ui | |
| parent | Some NR::Point ==> Geom::Point replacements (diff) | |
| download | inkscape-1ae6235112448547c758dd643a9ddd267a6cd580.tar.gz inkscape-1ae6235112448547c758dd643a9ddd267a6cd580.zip | |
More NR ==> Geom conversion (points and some matrices/transforms)
(bzr r6836)
Diffstat (limited to 'src/ui')
| -rw-r--r-- | src/ui/clipboard.cpp | 6 | ||||
| -rw-r--r-- | src/ui/dialog/align-and-distribute.cpp | 12 | ||||
| -rw-r--r-- | src/ui/dialog/transformation.cpp | 22 |
3 files changed, 20 insertions, 20 deletions
diff --git a/src/ui/clipboard.cpp b/src/ui/clipboard.cpp index 7bdb55d00..65cf14a95 100644 --- a/src/ui/clipboard.cpp +++ b/src/ui/clipboard.cpp @@ -142,7 +142,7 @@ private: void _createInternalClipboard(); void _discardInternalClipboard(); Inkscape::XML::Node *_createClipNode(); - NR::scale _getScale(Geom::Point const &, Geom::Point const &, Geom::Rect const &, bool, bool); + Geom::Scale _getScale(Geom::Point const &, Geom::Point const &, Geom::Rect const &, bool, bool); Glib::ustring _getBestTarget(); void _setClipboardTargets(); void _setClipboardColor(guint32); @@ -1174,7 +1174,7 @@ void ClipboardManagerImpl::_discardInternalClipboard() /** * @brief Get the scale to resize an item, based on the command and desktop state */ -NR::scale ClipboardManagerImpl::_getScale(Geom::Point const &min, Geom::Point const &max, Geom::Rect const &obj_rect, bool apply_x, bool apply_y) +Geom::Scale ClipboardManagerImpl::_getScale(Geom::Point const &min, Geom::Point const &max, Geom::Rect const &obj_rect, bool apply_x, bool apply_y) { SPDesktop *desktop = SP_ACTIVE_DESKTOP; double scale_x = 1.0; @@ -1193,7 +1193,7 @@ NR::scale ClipboardManagerImpl::_getScale(Geom::Point const &min, Geom::Point co if (apply_y && !apply_x) scale_x = scale_y; } - return NR::scale(scale_x, scale_y); + return Geom::Scale(scale_x, scale_y); } diff --git a/src/ui/dialog/align-and-distribute.cpp b/src/ui/dialog/align-and-distribute.cpp index ae7f0a64b..99d3fdda3 100644 --- a/src/ui/dialog/align-and-distribute.cpp +++ b/src/ui/dialog/align-and-distribute.cpp @@ -232,7 +232,7 @@ private : 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(*it, NR::translate(mp_rel)); + sp_item_move_rel(*it, Geom::Translate(mp_rel)); changed = true; } } @@ -365,7 +365,7 @@ private : if (!NR_DF_TEST_CLOSE (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, NR::translate(t)); + sp_item_move_rel(it->item, Geom::Translate(t)); changed = true; } pos += it->bbox[_orientation].extent(); @@ -390,7 +390,7 @@ private : Geom::Point t(0.0, 0.0); t[_orientation] = pos - it.anchor; //translate - sp_item_move_rel(it.item, NR::translate(t)); + sp_item_move_rel(it.item, Geom::Translate(t)); changed = true; } } @@ -632,7 +632,7 @@ private : g_random_double_range (0, (*_dialog.randomize_bbox)[Geom::Y].extent() - (*item_box).extent(Geom::Y)); // displacement is the new center minus old: NR::Point t = NR::Point (x, y) - 0.5*(item_box->max() + item_box->min()); - sp_item_move_rel(*it, NR::translate(t)); + sp_item_move_rel(*it, Geom::Translate(t)); } } @@ -731,7 +731,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, NR::translate(t)); + sp_item_move_rel(item, Geom::Translate(t)); changed = true; } @@ -750,7 +750,7 @@ private : Geom::Point base = layout->characterAnchorPoint(layout->begin()) * sp_item_i2d_affine(*it); Geom::Point t(0.0, 0.0); t[_orientation] = b_min[_orientation] - base[_orientation]; - sp_item_move_rel(*it, NR::translate(t)); + sp_item_move_rel(*it, Geom::Translate(t)); changed = true; } } diff --git a/src/ui/dialog/transformation.cpp b/src/ui/dialog/transformation.cpp index 29b6c37dd..0334b8541 100644 --- a/src/ui/dialog/transformation.cpp +++ b/src/ui/dialog/transformation.cpp @@ -638,7 +638,7 @@ Transformation::applyPageMove(Inkscape::Selection *selection) it < sorted.end(); it ++ ) { - sp_item_move_rel(it->item, NR::translate(move, 0)); + sp_item_move_rel(it->item, Geom::Translate(move, 0)); // move each next object by x relative to previous move += x; } @@ -662,7 +662,7 @@ Transformation::applyPageMove(Inkscape::Selection *selection) it < sorted.end(); it ++ ) { - sp_item_move_rel(it->item, NR::translate(0, move)); + sp_item_move_rel(it->item, Geom::Translate(0, move)); // move each next object by x relative to previous move += y; } @@ -689,7 +689,7 @@ Transformation::applyPageScale(Inkscape::Selection *selection) if (prefs_get_int_attribute_limited ("dialogs.transformation", "applyseparately", 0, 0, 1) == 1) { for (GSList const *l = selection->itemList(); l != NULL; l = l->next) { SPItem *item = SP_ITEM(l->data); - NR::scale scale (0,0); + Geom::Scale scale (0,0); // the values are increments! if (_units_scale.isAbsolute()) { boost::optional<NR::Rect> bbox(sp_item_bbox_desktop(item)); @@ -698,14 +698,14 @@ Transformation::applyPageScale(Inkscape::Selection *selection) if (fabs(new_width) < 1e-6) new_width = 1e-6; // not 0, as this would result in a nasty no-bbox object double new_height = scaleY; if (fabs(new_height) < 1e-6) new_height = 1e-6; - scale = NR::scale(new_width / bbox->extent(Geom::X), new_height / bbox->extent(Geom::Y)); + scale = Geom::Scale(new_width / bbox->extent(Geom::X), new_height / bbox->extent(Geom::Y)); } } else { double new_width = scaleX; if (fabs(new_width) < 1e-6) new_width = 1e-6; double new_height = scaleY; if (fabs(new_height) < 1e-6) new_height = 1e-6; - scale = NR::scale(new_width / 100.0, new_height / 100.0); + scale = Geom::Scale(new_width / 100.0, new_height / 100.0); } sp_item_scale_rel (item, scale); } @@ -713,20 +713,20 @@ Transformation::applyPageScale(Inkscape::Selection *selection) boost::optional<NR::Rect> bbox(selection->bounds()); if (bbox) { Geom::Point center(bbox->midpoint()); // use rotation center? - NR::scale scale (0,0); + Geom::Scale scale (0,0); // the values are increments! if (_units_scale.isAbsolute()) { double new_width = scaleX; if (fabs(new_width) < 1e-6) new_width = 1e-6; double new_height = scaleY; if (fabs(new_height) < 1e-6) new_height = 1e-6; - scale = NR::scale(new_width / bbox->extent(Geom::X), new_height / bbox->extent(Geom::Y)); + scale = Geom::Scale(new_width / bbox->extent(Geom::X), new_height / bbox->extent(Geom::Y)); } else { double new_width = scaleX; if (fabs(new_width) < 1e-6) new_width = 1e-6; double new_height = scaleY; if (fabs(new_height) < 1e-6) new_height = 1e-6; - scale = NR::scale(new_width / 100.0, new_height / 100.0); + scale = Geom::Scale(new_width / 100.0, new_height / 100.0); } sp_selection_scale_relative(selection, center, scale); } @@ -744,10 +744,10 @@ Transformation::applyPageRotate(Inkscape::Selection *selection) if (prefs_get_int_attribute_limited ("dialogs.transformation", "applyseparately", 0, 0, 1) == 1) { for (GSList const *l = selection->itemList(); l != NULL; l = l->next) { SPItem *item = SP_ITEM(l->data); - sp_item_rotate_rel(item, NR::rotate (angle*M_PI/180.0)); + sp_item_rotate_rel(item, Geom::Rotate (angle*M_PI/180.0)); } } else { - boost::optional<NR::Point> center = selection->center(); + boost::optional<Geom::Point> center = selection->center(); if (center) { sp_selection_rotate_relative(selection, *center, angle); } @@ -787,7 +787,7 @@ Transformation::applyPageSkew(Inkscape::Selection *selection) } } else { // transform whole selection boost::optional<NR::Rect> bbox = selection->bounds(); - boost::optional<NR::Point> center = selection->center(); + boost::optional<Geom::Point> center = selection->center(); if ( bbox && center ) { double width = bbox->extent(Geom::X); |
