Code

Use the visible curve (instead of original curve when a LPE is applied) for testing...
authorcilix42 <cilix42@users.sourceforge.net>
Mon, 18 Aug 2008 00:38:54 +0000 (00:38 +0000)
committercilix42 <cilix42@users.sourceforge.net>
Mon, 18 Aug 2008 00:38:54 +0000 (00:38 +0000)
src/shape-editor.cpp

index 3575d3405148372ad10240780cc37e8cac58c91c..b26b117cae1bea838c07591b88b32bfddcf87b9b 100644 (file)
@@ -30,6 +30,7 @@
 #include "style.h"
 #include "display/curve.h"
 #include <2geom/pathvector.h>
+#include "sp-shape.h"
 
 #include "shape-editor.h"
 
@@ -351,7 +352,12 @@ bool ShapeEditor::is_over_stroke (NR::Point event_p, bool remember) {
     this->curvepoint_doc = desktop->w2d(event_p);
     this->curvepoint_doc *= sp_item_dt2i_affine(item);
 
-    SPCurve *curve = this->nodepath->curve;   // not sure if np->curve is always up to date...
+    SPCurve *curve;
+    if (SP_IS_SHAPE(item)) {
+        curve = sp_shape_get_curve(SP_SHAPE(item));
+    } else {
+        this->nodepath->curve;   // not sure if np->curve is always up to date...
+    }
     Geom::PathVector const &pathv = curve->get_pathvector();
     Geom::PathVectorPosition pvpos = Geom::nearestPoint(pathv, this->curvepoint_doc);