summaryrefslogtreecommitdiffstats
path: root/src/sp-star.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-star.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-star.cpp')
-rw-r--r--src/sp-star.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/sp-star.cpp b/src/sp-star.cpp
index c7c2c54ad..d224ff1ba 100644
--- a/src/sp-star.cpp
+++ b/src/sp-star.cpp
@@ -548,20 +548,15 @@ sp_star_position_set (SPStar *star, gint sides, Geom::Point center, gdouble r1,
static void sp_star_snappoints(SPItem const *item, std::vector<Inkscape::SnapCandidatePoint> &p, Inkscape::SnapPreferences const *snapprefs)
{
// We will determine the star'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 ());
p.push_back(Inkscape::SnapCandidatePoint(SP_STAR(item)->center * i2dt,Inkscape::SNAPSOURCE_OBJECT_MIDPOINT, Inkscape::SNAPTARGET_OBJECT_MIDPOINT));
}