From e1010ee04e9654e977952b3c1f0a0ecb98ce6b50 Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Sun, 15 Aug 2010 21:54:12 +0200 Subject: [PATCH] 2nd attempt at fixing the crash introduced in rev. #9692. This should nail it! --- src/snap-candidate.h | 4 ++-- src/snap.cpp | 4 ++-- src/ui/tool/node.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/snap-candidate.h b/src/snap-candidate.h index a0fc3290c..5c2834403 100644 --- a/src/snap-candidate.h +++ b/src/snap-candidate.h @@ -42,11 +42,11 @@ public: _target_bbox = Geom::OptRect(); } - SnapCandidatePoint(Geom::Point const &point, Inkscape::SnapSourceType const source, long const source_num = 0) + SnapCandidatePoint(Geom::Point const &point, Inkscape::SnapSourceType const source) : _point(point), _source_type(source), _target_type(Inkscape::SNAPTARGET_UNDEFINED), - _source_num(source_num) + _source_num(0) { _target_bbox = Geom::OptRect(); } diff --git a/src/snap.cpp b/src/snap.cpp index bcdf6c94f..9cde24e16 100644 --- a/src/snap.cpp +++ b/src/snap.cpp @@ -342,7 +342,7 @@ void SnapManager::constrainedSnapReturnByRef(Geom::Point &p, Inkscape::Snapper::SnapConstraint const &constraint, Geom::OptRect const &bbox_to_snap) const { - Inkscape::SnappedPoint const s = constrainedSnap(Inkscape::SnapCandidatePoint(p, source_type, 0), constraint, bbox_to_snap); + Inkscape::SnappedPoint const s = constrainedSnap(Inkscape::SnapCandidatePoint(p, source_type), constraint, bbox_to_snap); s.getPoint(p); } @@ -609,7 +609,7 @@ Inkscape::SnappedPoint SnapManager::_snapTransformed( bbox.expandTo(transformed); } - transformed_points.push_back(Inkscape::SnapCandidatePoint(transformed, (*i).getSourceType(), source_num)); + transformed_points.push_back(Inkscape::SnapCandidatePoint(transformed, (*i).getSourceType(), source_num, Inkscape::SNAPTARGET_UNDEFINED, Geom::OptRect())); source_num++; } diff --git a/src/ui/tool/node.cpp b/src/ui/tool/node.cpp index f6fb6cc54..1070e4bc3 100644 --- a/src/ui/tool/node.cpp +++ b/src/ui/tool/node.cpp @@ -946,6 +946,7 @@ void Node::dragged(Geom::Point &new_pos, GdkEventMotion *event) SnapManager &sm = _desktop->namedview->snap_manager; bool snap = sm.someSnapperMightSnap(); Inkscape::SnappedPoint sp; + std::vector unselected; if (snap) { /* setup * TODO We are doing this every time a snap happens. It should once be done only once @@ -955,7 +956,6 @@ void Node::dragged(Geom::Point &new_pos, GdkEventMotion *event) * TODO Snapping to unselected segments of selected paths doesn't work yet. */ // Build the list of unselected nodes. - std::vector unselected; typedef ControlPointSelection::Set Set; Set &nodes = _selection.allPoints(); for (Set::iterator i = nodes.begin(); i != nodes.end(); ++i) { -- 2.30.2