From babb7a67749cb691674bdd9758f0568d4b094b56 Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Mon, 22 Aug 2011 20:27:53 +0200 Subject: Refactoring of the snapping preferences; mainly about storing all toggles in a single array, instead of each having its own member variable (bzr r10569) --- src/selection.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/selection.cpp') diff --git a/src/selection.cpp b/src/selection.cpp index 3007a3d1f..677e57d5f 100644 --- a/src/selection.cpp +++ b/src/selection.cpp @@ -433,9 +433,9 @@ std::vector Selection::getSnapPoints(SnapPreferenc GSList const *items = const_cast(this)->itemList(); SnapPreferences snapprefs_dummy = *snapprefs; // create a local copy of the snapping prefs - snapprefs_dummy.setIncludeItemCenter(false); // locally disable snapping to the item center - snapprefs_dummy.setSnapToItemNode(true); // consider any type of nodes as a snap source - snapprefs_dummy.setSnapSmoothNodes(true); // i.e. disregard the smooth / cusp node preference + snapprefs_dummy.setTargetSnappable(Inkscape::SNAPTARGET_ROTATION_CENTER, false); // locally disable snapping to the item center + //snapprefs_dummy.setTargetSnappable(Inkscape::SNAPTARGET_NODE_CUSP, true); // consider any type of nodes as a snap source + //snapprefs_dummy.setTargetSnappable(Inkscape::SNAPTARGET_NODE_SMOOTH, true); // i.e. disregard the smooth / cusp node preference std::vector p; for (GSList const *iter = items; iter != NULL; iter = iter->next) { SPItem *this_item = SP_ITEM(iter->data); @@ -443,7 +443,7 @@ std::vector Selection::getSnapPoints(SnapPreferenc //Include the transformation origin for snapping //For a selection or group only the overall origin is considered - if (snapprefs != NULL && snapprefs->getIncludeItemCenter()) { + if (snapprefs != NULL && snapprefs->isTargetSnappable(Inkscape::SNAPTARGET_ROTATION_CENTER)) { p.push_back(Inkscape::SnapCandidatePoint(this_item->getCenter(), SNAPSOURCE_ROTATION_CENTER)); } } @@ -456,8 +456,8 @@ std::vector Selection::getSnapPointsConvexHull(Sna GSList const *items = const_cast(this)->itemList(); SnapPreferences snapprefs_dummy = *snapprefs; // create a local copy of the snapping prefs - snapprefs_dummy.setSnapToItemNode(true); // consider any type of nodes as a snap source - snapprefs_dummy.setSnapSmoothNodes(true); // i.e. disregard the smooth / cusp node preference + snapprefs_dummy.setTargetSnappable(Inkscape::SNAPTARGET_NODE_CUSP, true); // consider any type of nodes as a snap source + snapprefs_dummy.setTargetSnappable(Inkscape::SNAPTARGET_NODE_SMOOTH, true); // i.e. disregard the smooth / cusp node preference std::vector p; for (GSList const *iter = items; iter != NULL; iter = iter->next) { -- cgit v1.2.3