summaryrefslogtreecommitdiffstats
path: root/src/snap-candidate.h
diff options
context:
space:
mode:
authorDiederik van Lierop <mail@diedenrezi.nl>2011-11-04 21:30:19 +0000
committerDiederik van Lierop <mail@diedenrezi.nl>2011-11-04 21:30:19 +0000
commit224a99dc216119d34eb3ed13d12f123158acfe3c (patch)
treecb012b688f276656612f2994e461fda3622bcd20 /src/snap-candidate.h
parentPowerstroke: add erasing of knots with ctrl+alt (LPE parameter editing on-can... (diff)
downloadinkscape-224a99dc216119d34eb3ed13d12f123158acfe3c.tar.gz
inkscape-224a99dc216119d34eb3ed13d12f123158acfe3c.zip
1) Cycle to the next-closest-snap-source when pressing tab, if the snap-closest-point-only-option has been activated. Works for the selector tool, but also when scaling/stretching/skewing a selection of nodes in the node tool
2) Cleanup and simplification of the code that finds the closest snapsource (bzr r10720)
Diffstat (limited to 'src/snap-candidate.h')
-rw-r--r--src/snap-candidate.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/snap-candidate.h b/src/snap-candidate.h
index 5302b49c9..857a2c2a4 100644
--- a/src/snap-candidate.h
+++ b/src/snap-candidate.h
@@ -71,6 +71,9 @@ public:
inline Inkscape::SnapTargetType getTargetType() const {return _target_type;}
inline long getSourceNum() const {return _source_num;}
void setSourceNum(long num) {_source_num = num;}
+ void setDistance(Geom::Coord dist) {_dist = dist;}
+ Geom::Coord getDistance() { return _dist;}
+ bool operator <(const SnapCandidatePoint other) const { return _dist < other._dist; } // Needed for sorting the SnapCandidatePoints
inline Geom::OptRect const getTargetBBox() const {return _target_bbox;}
boost::optional<Geom::Point> const & getStartingPoint() const {return _line_starting_point;}
@@ -93,6 +96,9 @@ private:
// If this is a target and it belongs to a bounding box, e.g. when the target type is
// SNAPTARGET_BBOX_EDGE_MIDPOINT, then _target_bbox stores the relevant bounding box
Geom::OptRect _target_bbox;
+
+ // For finding the snap candidate closest to the mouse pointer
+ Geom::Coord _dist;
};
class SnapCandidateItem
@@ -127,7 +133,5 @@ public:
bool currently_being_edited; // true for the path that's currently being edited in the node tool (if any)
};
-
} // end of namespace Inkscape
-
#endif /* !SEEN_SNAP_CANDIDATE_H */