summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 20c7762)
raw | patch | inline | side by side (parent: 20c7762)
author | Diederik van Lierop <mailat-signdiedenrezidotnl> | |
Sun, 24 Oct 2010 11:14:28 +0000 (13:14 +0200) | ||
committer | Diederik van Lierop <mailat-signdiedenrezidotnl> | |
Sun, 24 Oct 2010 11:14:28 +0000 (13:14 +0200) |
src/snap.cpp | patch | blob | history | |
src/snapped-point.cpp | patch | blob | history | |
src/snapped-point.h | patch | blob | history |
diff --git a/src/snap.cpp b/src/snap.cpp
index cac3824ab4c406c643ec3c295f0a179d1ca085c8..e14ef6ae9258c50374402bc83ec384b4bbb27b76 100644 (file)
--- a/src/snap.cpp
+++ b/src/snap.cpp
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);
}
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 48efa10e6fd3dacb1c51ee0ac7b6f311c0cf751a..22daf9103f7626d12a2e7889ca2032daeceeaa8c 100644 (file)
--- a/src/snapped-point.cpp
+++ b/src/snapped-point.cpp
{
}
-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 4b4882ee41bae54370ad8a108155e0eef0b83fb1..a28712e85f519f13b9d2017c2f08c86c229f6fd9 100644 (file)
--- a/src/snapped-point.h
+++ b/src/snapped-point.h
* 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