summaryrefslogtreecommitdiffstats
path: root/src/snapper.cpp
diff options
context:
space:
mode:
authorDiederik van Lierop <mail@diedenrezi.nl>2007-11-03 14:48:50 +0000
committerdvlierop2 <dvlierop2@users.sourceforge.net>2007-11-03 14:48:50 +0000
commit84504bd815a6ef3c5b7b5958ce46429cbab56a66 (patch)
treed74ae924d96f98b07658dcb67d46b64c486d1beb /src/snapper.cpp
parentAdded an icons file with a cleaned up current icon set (prefix "ink_" in thei... (diff)
downloadinkscape-84504bd815a6ef3c5b7b5958ce46429cbab56a66.tar.gz
inkscape-84504bd815a6ef3c5b7b5958ce46429cbab56a66.zip
Groundwork to snap to intersections, e.g. intersections of gridlines with guidelines, and of objects with other objects. The snappers used to return only SnappedPoints, but now also SnappedLines and SnappedInfiniteLines can be returned. SnappedPaths will be implemented later.
(bzr r4016)
Diffstat (limited to 'src/snapper.cpp')
-rw-r--r--src/snapper.cpp28
1 files changed, 18 insertions, 10 deletions
diff --git a/src/snapper.cpp b/src/snapper.cpp
index 17d7b7137..5edde2405 100644
--- a/src/snapper.cpp
+++ b/src/snapper.cpp
@@ -91,7 +91,9 @@ void Inkscape::Snapper::setEnabled(bool s)
* \return Snapped point.
*/
-Inkscape::SnappedPoint Inkscape::Snapper::freeSnap(PointType const &t,
+void Inkscape::Snapper::freeSnap(SnappedConstraints &sc,
+
+ PointType const &t,
NR::Point const &p,
bool const &first_point,
std::vector<NR::Point> &points_to_snap,
@@ -99,7 +101,7 @@ Inkscape::SnappedPoint Inkscape::Snapper::freeSnap(PointType const &t,
{
std::list<SPItem const *> lit;
lit.push_back(it);
- return freeSnap(t, p, first_point, points_to_snap, lit);
+ freeSnap(sc, t, p, first_point, points_to_snap, lit);
}
@@ -114,17 +116,19 @@ Inkscape::SnappedPoint Inkscape::Snapper::freeSnap(PointType const &t,
* \return Snapped point.
*/
-Inkscape::SnappedPoint Inkscape::Snapper::freeSnap(PointType const &t,
+void Inkscape::Snapper::freeSnap(SnappedConstraints &sc,
+
+ PointType const &t,
NR::Point const &p,
bool const &first_point,
std::vector<NR::Point> &points_to_snap,
std::list<SPItem const *> const &it) const
{
if (_enabled == false || getSnapFrom(t) == false) {
- return SnappedPoint(p, NR_HUGE);
+ return;
}
- return _doFreeSnap(t, p, first_point, points_to_snap, it);
+ _doFreeSnap(sc, t, p, first_point, points_to_snap, it);
}
@@ -141,7 +145,9 @@ Inkscape::SnappedPoint Inkscape::Snapper::freeSnap(PointType const &t,
* \return Snapped point.
*/
-Inkscape::SnappedPoint Inkscape::Snapper::constrainedSnap(PointType const &t,
+void Inkscape::Snapper::constrainedSnap(SnappedConstraints &sc,
+
+ PointType const &t,
NR::Point const &p,
bool const &first_point,
std::vector<NR::Point> &points_to_snap,
@@ -150,7 +156,7 @@ Inkscape::SnappedPoint Inkscape::Snapper::constrainedSnap(PointType const &t,
{
std::list<SPItem const *> lit;
lit.push_back(it);
- return constrainedSnap(t, p, first_point, points_to_snap, c, lit);
+ constrainedSnap(sc, t, p, first_point, points_to_snap, c, lit);
}
@@ -165,7 +171,9 @@ Inkscape::SnappedPoint Inkscape::Snapper::constrainedSnap(PointType const &t,
* \return Snapped point.
*/
-Inkscape::SnappedPoint Inkscape::Snapper::constrainedSnap(PointType const &t,
+void Inkscape::Snapper::constrainedSnap(SnappedConstraints &sc,
+
+ PointType const &t,
NR::Point const &p,
bool const &first_point,
std::vector<NR::Point> &points_to_snap,
@@ -173,10 +181,10 @@ Inkscape::SnappedPoint Inkscape::Snapper::constrainedSnap(PointType const &t,
std::list<SPItem const *> const &it) const
{
if (_enabled == false || getSnapFrom(t) == false) {
- return SnappedPoint(p, NR_HUGE);
+ return;
}
- return _doConstrainedSnap(t, p, first_point, points_to_snap, c, it);
+ _doConstrainedSnap(sc, t, p, first_point, points_to_snap, c, it);
}
/*