diff options
| author | Diederik van Lierop <mailat-signdiedenrezidotnl> | 2010-10-29 22:07:10 +0000 |
|---|---|---|
| committer | Diederik van Lierop <mailat-signdiedenrezidotnl> | 2010-10-29 22:07:10 +0000 |
| commit | ffba6ae904deaef040defebcc0ff6f7458dbb969 (patch) | |
| tree | 7b22f9c718ce74714a0398e1b70acfaba5ad6f4e /src/knot-holder-entity.cpp | |
| parent | Dropped not working accelator key (r9858 Bug #170765) (diff) | |
| download | inkscape-ffba6ae904deaef040defebcc0ff6f7458dbb969.tar.gz inkscape-ffba6ae904deaef040defebcc0ff6f7458dbb969.zip | |
- Constrained snap: proper implementation of the preference to snap the mouse pointer or handle itself (instead of projecting it first onto the constraint)
- Fix a crash in SnapManager::multipleConstrainedSnaps
(bzr r9866)
Diffstat (limited to 'src/knot-holder-entity.cpp')
| -rw-r--r-- | src/knot-holder-entity.cpp | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/src/knot-holder-entity.cpp b/src/knot-holder-entity.cpp index 0a449771e..24cfd8486 100644 --- a/src/knot-holder-entity.cpp +++ b/src/knot-holder-entity.cpp @@ -110,22 +110,10 @@ KnotHolderEntity::snap_knot_position_constrained(Geom::Point const &p, Inkscape: m.setup(desktop, true, item); Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - if ((prefs->getBool("/options/snapmousepointer/value", false))) { // legacy behavior (pre v0.47) - // Snapping the mouse pointer instead of the constrained position of the knot allows to snap to - // things which don't intersect with the constraint line. This should be handled by the - // smart dynamic guides which are yet to be implemented, making this behavior more clean and - // transparent. With the current implementation it leads to unexpected results, and it doesn't - // allow accurately controlling what is being snapped to. - - // freeSnap() will try snapping point p. This will not take into account the constraint, which - // is therefore to be enforced after snap_knot_position_constrained() has finished - m.freeSnapReturnByRef(s, Inkscape::SNAPSOURCE_NODE_HANDLE); - } else { - // constrainedSnap() will first project the point p onto the constraint line and then try to snap along that line. - // This way the constraint is already enforced, no need to worry about that later on - Inkscape::Snapper::SnapConstraint transformed_constraint = Inkscape::Snapper::SnapConstraint(constraint.getPoint() * i2d, (constraint.getPoint() + constraint.getDirection()) * i2d - constraint.getPoint() * i2d); - m.constrainedSnapReturnByRef(s, Inkscape::SNAPSOURCE_NODE_HANDLE, transformed_constraint); - } + // constrainedSnap() will first project the point p onto the constraint line and then try to snap along that line. + // This way the constraint is already enforced, no need to worry about that later on + Inkscape::Snapper::SnapConstraint transformed_constraint = Inkscape::Snapper::SnapConstraint(constraint.getPoint() * i2d, (constraint.getPoint() + constraint.getDirection()) * i2d - constraint.getPoint() * i2d); + m.constrainedSnapReturnByRef(s, Inkscape::SNAPSOURCE_NODE_HANDLE, transformed_constraint); m.unSetup(); return s * i2d.inverse(); |
