From 6e91f64f6479045c9d2fd7702879b73d5988faa2 Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Fri, 21 May 2010 23:46:07 +0200 Subject: - "Snap nodes or handles" button now also includes smooth nodes - Improved snap tooltips (bzr r9440) --- src/sp-shape.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src/sp-shape.cpp') diff --git a/src/sp-shape.cpp b/src/sp-shape.cpp index dadcb5f57..3064341b6 100644 --- a/src/sp-shape.cpp +++ b/src/sp-shape.cpp @@ -1227,7 +1227,24 @@ static void sp_shape_snappoints(SPItem const *item, std::vectorgetSnapSmoothNodes() && (nodetype == Geom::NODE_SMOOTH || nodetype == Geom::NODE_SYMM); if (c1 || c2) { - p.push_back(Inkscape::SnapCandidatePoint(curve_it1->finalPoint() * i2d, Inkscape::SNAPSOURCE_NODE_CUSP, Inkscape::SNAPTARGET_NODE_CUSP)); + Inkscape::SnapSourceType sst; + Inkscape::SnapTargetType stt; + switch (nodetype) { + case Geom::NODE_CUSP: + sst = Inkscape::SNAPSOURCE_NODE_CUSP; + stt = Inkscape::SNAPTARGET_NODE_CUSP; + break; + case Geom::NODE_SMOOTH: + case Geom::NODE_SYMM: + sst = Inkscape::SNAPSOURCE_NODE_SMOOTH; + stt = Inkscape::SNAPTARGET_NODE_SMOOTH; + break; + default: + sst = Inkscape::SNAPSOURCE_UNDEFINED; + stt = Inkscape::SNAPTARGET_UNDEFINED; + break; + } + p.push_back(Inkscape::SnapCandidatePoint(curve_it1->finalPoint() * i2d, sst, stt)); } // Consider midpoints of line segments for snapping -- cgit v1.2.3