diff options
| author | Diederik van Lierop <mail@diedenrezi.nl> | 2011-10-08 20:00:37 +0000 |
|---|---|---|
| committer | Diederik van Lierop <mail@diedenrezi.nl> | 2011-10-08 20:00:37 +0000 |
| commit | f4c59e50df9090a1a4801da06f9a0021b67ce7a2 (patch) | |
| tree | 825ce1a6b013c238a89f06c2fdf74cee0861e02b /src/snap.cpp | |
| parent | Doc. Keys and mouse reference update. (diff) | |
| download | inkscape-f4c59e50df9090a1a4801da06f9a0021b67ce7a2.tar.gz inkscape-f4c59e50df9090a1a4801da06f9a0021b67ce7a2.zip | |
1) make snapping to clip/mask paths optional (see document properties dialog -> snap tab)
2) for debugging purposes: code added for showing all snap candidates
3) groundwork for tangential/perpendicular snapping
(bzr r10672)
Diffstat (limited to 'src/snap.cpp')
| -rw-r--r-- | src/snap.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/snap.cpp b/src/snap.cpp index fb6f120ec..56b48d507 100644 --- a/src/snap.cpp +++ b/src/snap.cpp @@ -180,6 +180,13 @@ void SnapManager::freeSnapReturnByRef(Geom::Point &p, s.getPointIfSnapped(p); } +void SnapManager::freeSnapReturnByRef(Geom::Point &p, + Inkscape::SnapSourceType const source_type, + boost::optional<Geom::Point> &starting_point) const +{ + Inkscape::SnappedPoint const s = freeSnap(Inkscape::SnapCandidatePoint(p, source_type, starting_point), Geom::OptRect()); + s.getPointIfSnapped(p); +} /** * Try to snap a point to grids, guides or objects. @@ -1136,6 +1143,23 @@ Inkscape::SnappedPoint SnapManager::findBestSnap(Inkscape::SnapCandidatePoint co std::cout << " Curves : " << isr.curves.size()<< std::endl; */ + /* + // Display all snap candidates on the canvas + _desktop->snapindicator->remove_debugging_points(); + for (std::list<Inkscape::SnappedPoint>::const_iterator i = isr.points.begin(); i != isr.points.end(); i++) { + _desktop->snapindicator->set_new_debugging_point((*i).getPoint()); + } + for (std::list<Inkscape::SnappedCurve>::const_iterator i = isr.curves.begin(); i != isr.curves.end(); i++) { + _desktop->snapindicator->set_new_debugging_point((*i).getPoint()); + } + for (std::list<Inkscape::SnappedLine>::const_iterator i = isr.grid_lines.begin(); i != isr.grid_lines.end(); i++) { + _desktop->snapindicator->set_new_debugging_point((*i).getPoint()); + } + for (std::list<Inkscape::SnappedLine>::const_iterator i = isr.guide_lines.begin(); i != isr.guide_lines.end(); i++) { + _desktop->snapindicator->set_new_debugging_point((*i).getPoint()); + } + */ + // Store all snappoints std::list<Inkscape::SnappedPoint> sp_list; |
