diff options
Diffstat (limited to 'src/sp-spiral.cpp')
| -rw-r--r-- | src/sp-spiral.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/sp-spiral.cpp b/src/sp-spiral.cpp index e4bd0fa21..298a4444a 100644 --- a/src/sp-spiral.cpp +++ b/src/sp-spiral.cpp @@ -427,6 +427,7 @@ sp_spiral_set_shape (SPShape *shape) Geom::PathVector pv = sp_svg_read_pathv(shape->getRepr()->attribute("d")); SPCurve *cold = new SPCurve(pv); shape->setCurveInsync( cold, TRUE); + shape->setCurveBeforeLPE( cold ); cold->unref(); } return; @@ -470,6 +471,7 @@ sp_spiral_set_shape (SPShape *shape) /* Reset the shape'scurve to the "original_curve" * This is very important for LPEs to work properly! (the bbox might be recalculated depending on the curve in shape)*/ shape->setCurveInsync( c, TRUE); + shape->setCurveBeforeLPE( c ); if (sp_lpe_item_has_path_effect(SP_LPE_ITEM(shape)) && sp_lpe_item_path_effects_enabled(SP_LPE_ITEM(shape))) { SPCurve *c_lpe = c->copy(); bool success = sp_lpe_item_perform_path_effect(SP_LPE_ITEM (shape), c_lpe); @@ -518,23 +520,18 @@ 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())) { - return; - } - - if (snapprefs->getSnapObjectMidpoints()) { - Geom::Affine const i2d (item->i2d_affine ()); + 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) * i2d, Inkscape::SNAPSOURCE_OBJECT_MIDPOINT, Inkscape::SNAPTARGET_OBJECT_MIDPOINT)); + p.push_back(Inkscape::SnapCandidatePoint(Geom::Point(spiral->cx, spiral->cy) * i2dt, Inkscape::SNAPSOURCE_OBJECT_MIDPOINT, Inkscape::SNAPTARGET_OBJECT_MIDPOINT)); // This point is the start-point of the spiral, which is also returned when _snap_to_itemnode has been set // in the object snapper. In that case we will get a duplicate! } |
