summaryrefslogtreecommitdiffstats
path: root/src/line-snapper.cpp
diff options
context:
space:
mode:
authorDiederik van Lierop <mail@diedenrezi.nl>2008-04-30 07:32:12 +0000
committerdvlierop2 <dvlierop2@users.sourceforge.net>2008-04-30 07:32:12 +0000
commit8e980bd257a274f7f32aca2e05f2a694675cf4ef (patch)
tree4b2b83970d640c900a3eadb0266e29a92f088dde /src/line-snapper.cpp
parentmerge redundant language-agnostics options into CPPFLAGS, split off linker flags (diff)
downloadinkscape-8e980bd257a274f7f32aca2e05f2a694675cf4ef.tar.gz
inkscape-8e980bd257a274f7f32aca2e05f2a694675cf4ef.zip
- Major refactoring of snapping related code...
- Enabling snap indicator for all remaining tools (bzr r5556)
Diffstat (limited to 'src/line-snapper.cpp')
-rw-r--r--src/line-snapper.cpp26
1 files changed, 17 insertions, 9 deletions
diff --git a/src/line-snapper.cpp b/src/line-snapper.cpp
index b9974c2c0..efa6762b2 100644
--- a/src/line-snapper.cpp
+++ b/src/line-snapper.cpp
@@ -23,14 +23,18 @@ Inkscape::LineSnapper::LineSnapper(SPNamedView const *nv, NR::Coord const d) : S
}
-void Inkscape::LineSnapper::_doFreeSnap(SnappedConstraints &sc,
+void Inkscape::LineSnapper::freeSnap(SnappedConstraints &sc,
Inkscape::Snapper::PointType const &t,
NR::Point const &p,
- bool const &f,
- std::vector<NR::Point> &points_to_snap,
- std::vector<SPItem const *> const &it,
- std::vector<NR::Point> *unselected_nodes) const
+ bool const &/*f*/,
+ NR::Maybe<NR::Rect> const &/*bbox_to_snap*/,
+ std::vector<SPItem const *> const */*it*/,
+ std::vector<NR::Point> */*unselected_nodes*/) const
{
+ if (_snap_enabled == false || getSnapFrom(t) == false) {
+ return;
+ }
+
/* Get the lines that we will try to snap to */
const LineList lines = _getSnapLines(p);
@@ -53,15 +57,19 @@ void Inkscape::LineSnapper::_doFreeSnap(SnappedConstraints &sc,
}
}
-void Inkscape::LineSnapper::_doConstrainedSnap(SnappedConstraints &sc,
- Inkscape::Snapper::PointType const &/*t*/,
+void Inkscape::LineSnapper::constrainedSnap(SnappedConstraints &sc,
+ Inkscape::Snapper::PointType const &t,
NR::Point const &p,
bool const &/*f*/,
- std::vector<NR::Point> &/*points_to_snap*/,
+ NR::Maybe<NR::Rect> const &/*bbox_to_snap*/,
ConstraintLine const &c,
- std::vector<SPItem const *> const &/*it*/) const
+ std::vector<SPItem const *> const */*it*/) const
{
+ if (_snap_enabled == false || getSnapFrom(t) == false) {
+ return;
+ }
+
/* Get the lines that we will try to snap to */
const LineList lines = _getSnapLines(p);