diff --git a/src/snapper.cpp b/src/snapper.cpp
index 7a82fe1d462f384e3be8c9ff85146c1d3f768fff..1daa1d15183574d90839e1f668ec014b11155d3c 100644 (file)
--- a/src/snapper.cpp
+++ b/src/snapper.cpp
Inkscape::Snapper::PointType const Inkscape::Snapper::SNAPPOINT_BBOX = 0x1;
Inkscape::Snapper::PointType const Inkscape::Snapper::SNAPPOINT_NODE = 0x2;
+Inkscape::Snapper::PointType const Inkscape::Snapper::SNAPPOINT_GUIDE = 0x4;
/**
* Construct new Snapper for named view.
* \param nv Named view.
* \param d Snap distance.
*/
-Inkscape::Snapper::Snapper(SPNamedView const *nv, NR::Coord const d) : _named_view(nv), _enabled(true), _distance(d)
+Inkscape::Snapper::Snapper(SPNamedView const *nv, NR::Coord const d) : _named_view(nv), _snap_enabled(true), _distance(d)
{
g_assert(_named_view != NULL);
g_assert(SP_IS_NAMEDVIEW(_named_view));
void Inkscape::Snapper::setEnabled(bool s)
{
- _enabled = s;
+ _snap_enabled = 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,
SPItem const *it) const
{
std::list<SPItem const *> lit;
lit.push_back(it);
- return freeSnap(t, p, lit);
+ freeSnap(sc, t, p, first_point, points_to_snap, lit);
}
* \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);
+ if (_snap_enabled == false || getSnapFrom(t) == false) {
+ return;
}
- return _doFreeSnap(t, p, it);
+ _doFreeSnap(sc, t, p, first_point, points_to_snap, it);
}
* \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,
ConstraintLine const &c,
SPItem const *it) const
{
std::list<SPItem const *> lit;
lit.push_back(it);
- return constrainedSnap(t, p, c, lit);
+ constrainedSnap(sc, t, p, first_point, points_to_snap, c, lit);
}
* \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,
ConstraintLine const &c,
std::list<SPItem const *> const &it) const
{
- if (_enabled == false || getSnapFrom(t) == false) {
- return SnappedPoint(p, NR_HUGE);
+ if (_snap_enabled == false || getSnapFrom(t) == false) {
+ return;
}
- return _doConstrainedSnap(t, p, c, it);
+ _doConstrainedSnap(sc, t, p, first_point, points_to_snap, c, it);
}
/*