summaryrefslogtreecommitdiffstats
path: root/src/sp-spiral.cpp
diff options
context:
space:
mode:
authorDiederik van Lierop <mail@diedenrezi.nl>2011-08-22 18:27:53 +0000
committerDiederik van Lierop <mail@diedenrezi.nl>2011-08-22 18:27:53 +0000
commitbabb7a67749cb691674bdd9758f0568d4b094b56 (patch)
treed1e71acda1562bf3d394aa76f44b96be1175ca61 /src/sp-spiral.cpp
parentsvgfont2layers extension: glyph layers (except the first one) are innitially ... (diff)
downloadinkscape-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/sp-spiral.cpp')
-rw-r--r--src/sp-spiral.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/sp-spiral.cpp b/src/sp-spiral.cpp
index 3ba05adc6..298a4444a 100644
--- a/src/sp-spiral.cpp
+++ b/src/sp-spiral.cpp
@@ -520,20 +520,15 @@ sp_spiral_position_set (SPSpiral *spiral,
static void sp_spiral_snappoints(SPItem const *item, std::vector<Inkscape::SnapCandidatePoint> &p, Inkscape::SnapPreferences const *snapprefs)
{
// We will determine the spiral's midpoint ourselves, instead of trusting on the base class
- // Therefore setSnapObjectMidpoints() is set to false temporarily
+ // Therefore snapping to object midpoints is temporarily disabled
Inkscape::SnapPreferences local_snapprefs = *snapprefs;
- local_snapprefs.setSnapObjectMidpoints(false);
+ local_snapprefs.setTargetSnappable(Inkscape::SNAPTARGET_OBJECT_MIDPOINT, false);
if (((SPItemClass *) parent_class)->snappoints) {
((SPItemClass *) parent_class)->snappoints (item, p, &local_snapprefs);
}
- // Help enforcing strict snapping, i.e. only return nodes when we're snapping nodes to nodes or a guide to nodes
- if (!(snapprefs->getSnapModeNode() || snapprefs->getSnapModeGuide() || snapprefs->getSnapModeOthers())) {
- return;
- }
-
- if (snapprefs->getSnapObjectMidpoints()) {
+ if (snapprefs->isTargetSnappable(Inkscape::SNAPTARGET_OBJECT_MIDPOINT)) {
Geom::Affine const i2dt (item->i2dt_affine ());
SPSpiral *spiral = SP_SPIRAL(item);
p.push_back(Inkscape::SnapCandidatePoint(Geom::Point(spiral->cx, spiral->cy) * i2dt, Inkscape::SNAPSOURCE_OBJECT_MIDPOINT, Inkscape::SNAPTARGET_OBJECT_MIDPOINT));