From: Diederik van Lierop Date: Sun, 24 Oct 2010 11:14:28 +0000 (+0200) Subject: Fix paraxial pen tool: apply constraint even if we didn't snap X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=d1fce0891511046d15431675a93b6e56c302018c;p=inkscape.git Fix paraxial pen tool: apply constraint even if we didn't snap --- diff --git a/src/snap.cpp b/src/snap.cpp index cac3824ab..e14ef6ae9 100644 --- a/src/snap.cpp +++ b/src/snap.cpp @@ -179,7 +179,7 @@ void SnapManager::freeSnapReturnByRef(Geom::Point &p, Geom::OptRect const &bbox_to_snap) const { Inkscape::SnappedPoint const s = freeSnap(Inkscape::SnapCandidatePoint(p, source_type), bbox_to_snap); - s.getPoint(p); + s.getPointIfSnapped(p); } @@ -343,7 +343,7 @@ void SnapManager::constrainedSnapReturnByRef(Geom::Point &p, Geom::OptRect const &bbox_to_snap) const { Inkscape::SnappedPoint const s = constrainedSnap(Inkscape::SnapCandidatePoint(p, source_type), constraint, bbox_to_snap); - s.getPoint(p); + p = s.getPoint(); // If we didn't snap, then we will return the point projected onto the constraint } /** @@ -498,7 +498,7 @@ void SnapManager::guideFreeSnap(Geom::Point &p, Geom::Point const &guide_normal, Inkscape::SnappedPoint const s = findBestSnap(candidate, sc, false, false); - s.getPoint(p); + s.getPointIfSnapped(p); } /** @@ -542,7 +542,7 @@ void SnapManager::guideConstrainedSnap(Geom::Point &p, SPGuide const &guideline) } Inkscape::SnappedPoint const s = findBestSnap(candidate, sc, false); - s.getPoint(p); + s.getPointIfSnapped(p); } /** diff --git a/src/snapped-point.cpp b/src/snapped-point.cpp index 48efa10e6..22daf9103 100644 --- a/src/snapped-point.cpp +++ b/src/snapped-point.cpp @@ -100,7 +100,7 @@ Inkscape::SnappedPoint::~SnappedPoint() { } -void Inkscape::SnappedPoint::getPoint(Geom::Point &p) const +void Inkscape::SnappedPoint::getPointIfSnapped(Geom::Point &p) const { // When we have snapped if (getSnapped()) { diff --git a/src/snapped-point.h b/src/snapped-point.h index 4b4882ee4..a28712e85 100644 --- a/src/snapped-point.h +++ b/src/snapped-point.h @@ -48,7 +48,7 @@ public: * to, because it only returns a point if snapping has actually occurred * (by overwriting p) */ - void getPoint(Geom::Point &p) const; + void getPointIfSnapped(Geom::Point &p) const; /* This method however always returns a point, even if no snapping * has occurred; A check should be implemented in the calling code