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/sp-spiral.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/sp-spiral.cpp')
| -rw-r--r-- | src/sp-spiral.cpp | 11 |
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)); |
