summaryrefslogtreecommitdiffstats
path: root/src/object-snapper.cpp
diff options
context:
space:
mode:
authorDiederik van Lierop <mailat-signdiedenrezidotnl>2010-05-22 20:06:35 +0000
committerDiederik van Lierop <mailat-signdiedenrezidotnl>2010-05-22 20:06:35 +0000
commitf662576d876552dd6e910fbced6f077594c4e847 (patch)
tree493503876b0f400ce23de4b463f20a197a316d2b /src/object-snapper.cpp
parentTemporary build fix for not newest gtk versions. (diff)
downloadinkscape-f662576d876552dd6e910fbced6f077594c4e847.tar.gz
inkscape-f662576d876552dd6e910fbced6f077594c4e847.zip
Snapping: get rid of the false positives when calculating intersections
(bzr r9442)
Diffstat (limited to 'src/object-snapper.cpp')
-rw-r--r--src/object-snapper.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/object-snapper.cpp b/src/object-snapper.cpp
index 5c0ea419b..bced0ac44 100644
--- a/src/object-snapper.cpp
+++ b/src/object-snapper.cpp
@@ -441,6 +441,9 @@ void Inkscape::ObjectSnapper::_snapPaths(SnappedConstraints &sc,
}
}
+ int num_path = 0;
+ int num_segm = 0;
+
for (std::vector<Inkscape::SnapCandidatePath >::const_iterator it_p = _paths_to_snap_to->begin(); it_p != _paths_to_snap_to->end(); it_p++) {
bool const being_edited = node_tool_active && (*it_p).currently_being_edited;
//if true then this pathvector it_pv is currently being edited in the node tool
@@ -482,11 +485,13 @@ void Inkscape::ObjectSnapper::_snapPaths(SnappedConstraints &sc,
if (!being_edited || (c1 && c2)) {
Geom::Coord const dist = Geom::distance(sp_doc, p_doc);
if (dist < getSnapperTolerance()) {
- sc.curves.push_back(Inkscape::SnappedCurve(sp_dt, dist, getSnapperTolerance(), getSnapperAlwaysSnap(), false, curve, p.getSourceType(), p.getSourceNum(), it_p->target_type, it_p->target_bbox));
+ sc.curves.push_back(Inkscape::SnappedCurve(sp_dt, num_path, num_segm, dist, getSnapperTolerance(), getSnapperAlwaysSnap(), false, curve, p.getSourceType(), p.getSourceNum(), it_p->target_type, it_p->target_bbox));
}
}
}
+ num_segm++;
} // End of: for (Geom::PathVector::iterator ....)
+ num_path++;
}
}