diff options
| author | Ted Gould <ted@gould.cx> | 2010-07-13 20:16:51 +0000 |
|---|---|---|
| committer | Ted Gould <ted@gould.cx> | 2010-07-13 20:16:51 +0000 |
| commit | ef2d72d29fce61231bdd7888ab8330503158e9d6 (patch) | |
| tree | 4685bfddef010181fdd87fc182016b994f2b69d9 /src/selection.cpp | |
| parent | Pulling in a more recent trunk (diff) | |
| parent | Translations. Romanian nsh file update. (diff) | |
| download | inkscape-ef2d72d29fce61231bdd7888ab8330503158e9d6.tar.gz inkscape-ef2d72d29fce61231bdd7888ab8330503158e9d6.zip | |
Upgrading to trunk
(bzr r8254.1.57)
Diffstat (limited to 'src/selection.cpp')
| -rw-r--r-- | src/selection.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/selection.cpp b/src/selection.cpp index 1e14591fa..96c66e0c5 100644 --- a/src/selection.cpp +++ b/src/selection.cpp @@ -424,14 +424,15 @@ boost::optional<Geom::Point> Selection::center() const { } /** - * Compute the list of points in the selection that are to be considered for snapping. + * Compute the list of points in the selection that are to be considered for snapping from. */ std::vector<Inkscape::SnapCandidatePoint> Selection::getSnapPoints(SnapPreferences const *snapprefs) const { 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 std::vector<Inkscape::SnapCandidatePoint> p; for (GSList const *iter = items; iter != NULL; iter = iter->next) { SPItem *this_item = SP_ITEM(iter->data); @@ -446,13 +447,18 @@ std::vector<Inkscape::SnapCandidatePoint> Selection::getSnapPoints(SnapPreferenc return p; } - +// TODO: both getSnapPoints and getSnapPointsConvexHull are called, subsequently. Can we do this more efficient? +// Why do we need to include the transformation center in one case and not the other? std::vector<Inkscape::SnapCandidatePoint> Selection::getSnapPointsConvexHull(SnapPreferences const *snapprefs) const { 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 + std::vector<Inkscape::SnapCandidatePoint> p; for (GSList const *iter = items; iter != NULL; iter = iter->next) { - sp_item_snappoints(SP_ITEM(iter->data), p, snapprefs); + sp_item_snappoints(SP_ITEM(iter->data), p, &snapprefs_dummy); } std::vector<Inkscape::SnapCandidatePoint> pHull; |
