Code

2nd attempt at fixing the crash introduced in rev. #9692. This should nail it!
authorDiederik van Lierop <mailat-signdiedenrezidotnl>
Sun, 15 Aug 2010 19:54:12 +0000 (21:54 +0200)
committerDiederik van Lierop <mailat-signdiedenrezidotnl>
Sun, 15 Aug 2010 19:54:12 +0000 (21:54 +0200)
src/snap-candidate.h
src/snap.cpp
src/ui/tool/node.cpp

index a0fc3290cde5892d37c9e97188b728f3e2b62222..5c283440305ce7570d7744457f43b5972886dfbb 100644 (file)
@@ -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();
     }
index bcdf6c94faa017682826e5e8c635fcc3b81a6ea7..9cde24e16b25ed80354a7ebe0843308e24ad070d 100644 (file)
@@ -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++;
     }
 
index f6fb6cc54da0562dc261c9506815637b5a806fc9..1070e4bc38d6deb0df3700b0520b406a4e972a9e 100644 (file)
@@ -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<Inkscape::SnapCandidatePoint> 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<Inkscape::SnapCandidatePoint> unselected;
         typedef ControlPointSelection::Set Set;
         Set &nodes = _selection.allPoints();
         for (Set::iterator i = nodes.begin(); i != nodes.end(); ++i) {