summaryrefslogtreecommitdiffstats
path: root/src/line-snapper.cpp
diff options
context:
space:
mode:
authorDiederik van Lierop <mail@diedenrezi.nl>2009-02-20 21:49:07 +0000
committerdvlierop2 <dvlierop2@users.sourceforge.net>2009-02-20 21:49:07 +0000
commit7860d701fd23d8e5f03086c249d30759732f07fd (patch)
treec3b8f351366407783eb5c96ba4fcdbbc7a132da9 /src/line-snapper.cpp
parentSome filters and extensions updates (diff)
downloadinkscape-7860d701fd23d8e5f03086c249d30759732f07fd.tar.gz
inkscape-7860d701fd23d8e5f03086c249d30759732f07fd.zip
The snap indicator's tooltip now displays "A to B", whereas before it only displayed "B".
(bzr r7335)
Diffstat (limited to 'src/line-snapper.cpp')
-rw-r--r--src/line-snapper.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/line-snapper.cpp b/src/line-snapper.cpp
index bc43d640b..d751993dd 100644
--- a/src/line-snapper.cpp
+++ b/src/line-snapper.cpp
@@ -26,10 +26,11 @@ Inkscape::LineSnapper::LineSnapper(SnapManager *sm, Geom::Coord const d) : Snapp
void Inkscape::LineSnapper::freeSnap(SnappedConstraints &sc,
Inkscape::SnapPreferences::PointType const &t,
Geom::Point const &p,
+ SnapSourceType const &source_type,
bool const &/*f*/,
Geom::OptRect const &/*bbox_to_snap*/,
std::vector<SPItem const *> const */*it*/,
- std::vector<Geom::Point> */*unselected_nodes*/) const
+ std::vector<std::pair<Geom::Point, int> > */*unselected_nodes*/) const
{
if (!(_snap_enabled && _snapmanager->snapprefs.getSnapFrom(t)) ) {
return;
@@ -50,7 +51,8 @@ void Inkscape::LineSnapper::freeSnap(SnappedConstraints &sc,
Geom::Coord const dist = Geom::L2(p_proj - p);
//Store any line that's within snapping range
if (dist < getSnapperTolerance()) {
- _addSnappedLine(sc, p_proj, dist, i->first, i->second);
+ _addSnappedLine(sc, p_proj, dist, source_type, Inkscape::SNAPTARGET_UNDEFINED, i->first, i->second);
+ // We don't know if we're snapping to grids or guides here; therefore the snap target type will be set in findBestSnap()
// std::cout << " -> distance = " << dist;
}
// std::cout << std::endl;
@@ -60,6 +62,7 @@ void Inkscape::LineSnapper::freeSnap(SnappedConstraints &sc,
void Inkscape::LineSnapper::constrainedSnap(SnappedConstraints &sc,
Inkscape::SnapPreferences::PointType const &t,
Geom::Point const &p,
+ SnapSourceType const &source_type,
bool const &/*f*/,
Geom::OptRect const &/*bbox_to_snap*/,
ConstraintLine const &c,
@@ -97,9 +100,7 @@ void Inkscape::LineSnapper::constrainedSnap(SnappedConstraints &sc,
// This snappoint is therefore fully constrained, so there's no need
// to look for additional intersections; just return the snapped point
// and forget about the line
- sc.points.push_back(SnappedPoint(t, Inkscape::SNAPTARGET_UNDEFINED, dist, getSnapperTolerance(), getSnapperAlwaysSnap(), true));
- // The type of the snap target is yet undefined, as we cannot tell whether
- // we're snapping to grid or the guide lines; must be set by on a higher level
+ sc.points.push_back(SnappedPoint(t, source_type, Inkscape::SNAPTARGET_UNDEFINED, dist, getSnapperTolerance(), getSnapperAlwaysSnap(), true));
}
}
}