summaryrefslogtreecommitdiffstats
path: root/src/sp-spiral.cpp
diff options
context:
space:
mode:
authorbulia byak <buliabyak@gmail.com>2009-08-22 21:49:32 +0000
committerbuliabyak <buliabyak@users.sourceforge.net>2009-08-22 21:49:32 +0000
commit6c059afd9ecdd6fc153e8e9ce0a9e5817fa3086c (patch)
tree95b3520ec96e0f8ad5f695f4d70ca483848ab9e2 /src/sp-spiral.cpp
parentfix 272408 and address fixmes: fix inheriting of dasharray and dashoffset, ma... (diff)
downloadinkscape-6c059afd9ecdd6fc153e8e9ce0a9e5817fa3086c.tar.gz
inkscape-6c059afd9ecdd6fc153e8e9ce0a9e5817fa3086c.zip
fix rendering of testcase errorhandling-nosuchlpe.svg: make sure shapes do not calculate the curve if they have a broken lpe, instead reading it directly from d= and issuing a warning
(bzr r8520)
Diffstat (limited to 'src/sp-spiral.cpp')
-rw-r--r--src/sp-spiral.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/sp-spiral.cpp b/src/sp-spiral.cpp
index 71906fcc0..629715332 100644
--- a/src/sp-spiral.cpp
+++ b/src/sp-spiral.cpp
@@ -20,6 +20,7 @@
#include "svg/svg.h"
#include "attributes.h"
#include <2geom/bezier-utils.h>
+#include <2geom/pathvector.h>
#include "display/curve.h"
#include <glibmm/i18n.h>
#include "xml/repr.h"
@@ -418,11 +419,23 @@ sp_spiral_fit_and_draw (SPSpiral const *spiral,
static void
sp_spiral_set_shape (SPShape *shape)
{
+ SPSpiral *spiral = SP_SPIRAL(shape);
+
+ if (sp_lpe_item_has_broken_path_effect(SP_LPE_ITEM(shape))) {
+ g_warning ("The spiral shape has unknown LPE on it! Convert to path to make it editable preserving the appearance; editing it as spiral will remove the bad LPE");
+ if (SP_OBJECT_REPR(shape)->attribute("d")) {
+ // unconditionally read the curve from d, if any, to preserve appearance
+ Geom::PathVector pv = sp_svg_read_pathv(SP_OBJECT_REPR(shape)->attribute("d"));
+ SPCurve *cold = new SPCurve(pv);
+ sp_shape_set_curve_insync (shape, cold, TRUE);
+ cold->unref();
+ }
+ return;
+ }
+
Geom::Point darray[SAMPLE_SIZE + 1];
double t;
- SPSpiral *spiral = SP_SPIRAL(shape);
-
SP_OBJECT (spiral)->requestModified(SP_OBJECT_MODIFIED_FLAG);
SPCurve *c = new SPCurve ();