diff options
| author | Diederik van Lierop <mail@diedenrezi.nl> | 2011-08-22 18:27:53 +0000 |
|---|---|---|
| committer | Diederik van Lierop <mail@diedenrezi.nl> | 2011-08-22 18:27:53 +0000 |
| commit | babb7a67749cb691674bdd9758f0568d4b094b56 (patch) | |
| tree | d1e71acda1562bf3d394aa76f44b96be1175ca61 /src/selection.cpp | |
| parent | svgfont2layers extension: glyph layers (except the first one) are innitially ... (diff) | |
| download | inkscape-babb7a67749cb691674bdd9758f0568d4b094b56.tar.gz inkscape-babb7a67749cb691674bdd9758f0568d4b094b56.zip | |
Refactoring of the snapping preferences; mainly about storing all toggles in a single array, instead of each having its own member variable
(bzr r10569)
Diffstat (limited to 'src/selection.cpp')
| -rw-r--r-- | src/selection.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
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<Inkscape::SnapCandidatePoint> Selection::getSnapPoints(SnapPreferenc GSList const *items = const_cast<Selection *>(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<Inkscape::SnapCandidatePoint> p; for (GSList const *iter = items; iter != NULL; iter = iter->next) { SPItem *this_item = SP_ITEM(iter->data); @@ -443,7 +443,7 @@ std::vector<Inkscape::SnapCandidatePoint> 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<Inkscape::SnapCandidatePoint> Selection::getSnapPointsConvexHull(Sna GSList const *items = const_cast<Selection *>(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<Inkscape::SnapCandidatePoint> p; for (GSList const *iter = items; iter != NULL; iter = iter->next) { |
