diff options
| author | Diederik van Lierop <mailat-signdiedenrezidotnl> | 2010-10-19 20:50:03 +0000 |
|---|---|---|
| committer | Diederik van Lierop <mailat-signdiedenrezidotnl> | 2010-10-19 20:50:03 +0000 |
| commit | 176e8ce89cd15a6bb3469ebac57736b3a0688e35 (patch) | |
| tree | 25929a1f80fe64312c98152778723adc1e54fb0a /src/line-snapper.cpp | |
| parent | Translations. POT files and French translation update. (diff) | |
| download | inkscape-176e8ce89cd15a6bb3469ebac57736b3a0688e35.tar.gz inkscape-176e8ce89cd15a6bb3469ebac57736b3a0688e35.zip | |
Use a better snap metric for constrained snapping (i.e. calculate the distance to the original point, not the projected point). This should more accurately predict what the user wants to snap to
(bzr r9837)
Diffstat (limited to 'src/line-snapper.cpp')
| -rw-r--r-- | src/line-snapper.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/line-snapper.cpp b/src/line-snapper.cpp index be64438ed..22a964d43 100644 --- a/src/line-snapper.cpp +++ b/src/line-snapper.cpp @@ -99,8 +99,8 @@ void Inkscape::LineSnapper::constrainedSnap(SnappedConstraints &sc, Geom::Coord d = Geom::L2(gridguide_line.versor()); // length of versor, needed to normalize the versor if (d > 0) { Geom::Point v = l*gridguide_line.versor()/d; - _addSnappedPoint(sc, p_proj + v, Geom::L2(pp - (p_proj + v)), p.getSourceType(), p.getSourceNum(), true); - _addSnappedPoint(sc, p_proj - v, Geom::L2(pp - (p_proj - v)), p.getSourceType(), p.getSourceNum(), true); + _addSnappedPoint(sc, p_proj + v, Geom::L2(p.getPoint() - (p_proj + v)), p.getSourceType(), p.getSourceNum(), true); + _addSnappedPoint(sc, p_proj - v, Geom::L2(p.getPoint() - (p_proj - v)), p.getSourceType(), p.getSourceNum(), true); } } } else { @@ -119,7 +119,7 @@ void Inkscape::LineSnapper::constrainedSnap(SnappedConstraints &sc, if (inters) { Geom::Point t = constraint_line.pointAt((*inters).ta); - const Geom::Coord dist = Geom::L2(t - pp); + const Geom::Coord dist = Geom::L2(t - p.getPoint()); if (dist < getSnapperTolerance()) { // When doing a constrained snap, we're already at an intersection. // This snappoint is therefore fully constrained, so there's no need |
