summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2015-07-19 13:22:31 +0000
committerKrzysztof KosiƄski <tweenk.pl@gmail.com>2015-07-19 13:22:31 +0000
commit1997b7aeecff6a01b3e319cd2a42a6029bc56ae7 (patch)
tree25d7a6673bca4c0f8e6187dd24de3f1381fb2637 /src
parentsetStitching(), gajiosdfksdsfd (diff)
downloadinkscape-1997b7aeecff6a01b3e319cd2a42a6029bc56ae7.tar.gz
inkscape-1997b7aeecff6a01b3e319cd2a42a6029bc56ae7.zip
Enable stitching in Spiro and SPCurve to prevent some crashes
(bzr r14250)
Diffstat (limited to 'src')
-rw-r--r--src/display/curve.cpp5
-rw-r--r--src/live_effects/spiro-converters.cpp6
-rw-r--r--src/live_effects/spiro-converters.h6
-rw-r--r--src/live_effects/spiro.h6
4 files changed, 12 insertions, 11 deletions
diff --git a/src/display/curve.cpp b/src/display/curve.cpp
index 386c63166..3024d1276 100644
--- a/src/display/curve.cpp
+++ b/src/display/curve.cpp
@@ -203,8 +203,9 @@ SPCurve::moveto(double x, double y)
void
SPCurve::moveto(Geom::Point const &p)
{
- _pathv.push_back( Geom::Path() ); // for some reason Geom::Path(p) does not work...
- _pathv.back().start(p);
+ Geom::Path path(p);
+ path.setStitching(true);
+ _pathv.push_back(path);
}
/**
diff --git a/src/live_effects/spiro-converters.cpp b/src/live_effects/spiro-converters.cpp
index 3c7bdf99e..f116d5256 100644
--- a/src/live_effects/spiro-converters.cpp
+++ b/src/live_effects/spiro-converters.cpp
@@ -64,7 +64,11 @@ ConverterSPCurve::curveto(double x1, double y1, double x2, double y2, double x3,
}
-
+ConverterPath::ConverterPath(Geom::Path &path)
+ : _path(path)
+{
+ _path.setStitching(true);
+}
void
ConverterPath::moveto(double x, double y, bool is_open)
diff --git a/src/live_effects/spiro-converters.h b/src/live_effects/spiro-converters.h
index 83f6ebbc3..90855d2d6 100644
--- a/src/live_effects/spiro-converters.h
+++ b/src/live_effects/spiro-converters.h
@@ -25,7 +25,7 @@ class ConverterSPCurve : public ConverterBase {
public:
ConverterSPCurve(SPCurve &curve)
: _curve(curve)
- {} ;
+ {}
virtual void moveto(double x, double y, bool is_open);
virtual void lineto(double x, double y);
@@ -45,9 +45,7 @@ private:
*/
class ConverterPath : public ConverterBase {
public:
- ConverterPath(Geom::Path &path)
- : _path(path)
- {} ;
+ ConverterPath(Geom::Path &path);
virtual void moveto(double x, double y, bool is_open);
virtual void lineto(double x, double y);
diff --git a/src/live_effects/spiro.h b/src/live_effects/spiro.h
index 0d85da74b..066b44ca8 100644
--- a/src/live_effects/spiro.h
+++ b/src/live_effects/spiro.h
@@ -25,11 +25,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
#define INKSCAPE_SPIRO_H
#include "live_effects/spiro-converters.h"
+#include <2geom/forward.h>
class SPCurve;
-namespace Geom {
- class Path;
-}
namespace Spiro {
@@ -53,4 +51,4 @@ double get_knot_th(const spiro_seg *s, int i);
} // namespace Spiro
-#endif // INKSCAPE_SPIRO_H \ No newline at end of file
+#endif // INKSCAPE_SPIRO_H