From 8b04d0db6c55e36935690d37defb6f9b68945796 Mon Sep 17 00:00:00 2001 From: johnce Date: Wed, 5 Aug 2009 05:40:36 +0000 Subject: SPDocument->Document (bzr r8404) --- src/sp-spiral.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/sp-spiral.cpp') diff --git a/src/sp-spiral.cpp b/src/sp-spiral.cpp index 71906fcc0..f0f95fb9c 100644 --- a/src/sp-spiral.cpp +++ b/src/sp-spiral.cpp @@ -30,7 +30,7 @@ static void sp_spiral_class_init (SPSpiralClass *klass); static void sp_spiral_init (SPSpiral *spiral); -static void sp_spiral_build (SPObject * object, SPDocument * document, Inkscape::XML::Node * repr); +static void sp_spiral_build (SPObject * object, Document * document, Inkscape::XML::Node * repr); static Inkscape::XML::Node *sp_spiral_write (SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags); static void sp_spiral_set (SPObject *object, unsigned int key, const gchar *value); static void sp_spiral_update (SPObject *object, SPCtx *ctx, guint flags); @@ -123,7 +123,7 @@ sp_spiral_init (SPSpiral * spiral) * Virtual build: set spiral properties from corresponding repr. */ static void -sp_spiral_build (SPObject * object, SPDocument * document, Inkscape::XML::Node * repr) +sp_spiral_build (SPObject * object, Document * document, Inkscape::XML::Node * repr) { if (((SPObjectClass *) parent_class)->build) ((SPObjectClass *) parent_class)->build (object, document, repr); -- cgit v1.2.3 From 51c2905fd3e99955db2d823b79abb763d8097028 Mon Sep 17 00:00:00 2001 From: Maximilian Albert Date: Thu, 6 Aug 2009 14:17:17 +0000 Subject: Revert recent refactoring changes by johnce because they break the build, which cannot be fixed easily. (bzr r8422) --- src/sp-spiral.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/sp-spiral.cpp') diff --git a/src/sp-spiral.cpp b/src/sp-spiral.cpp index f0f95fb9c..71906fcc0 100644 --- a/src/sp-spiral.cpp +++ b/src/sp-spiral.cpp @@ -30,7 +30,7 @@ static void sp_spiral_class_init (SPSpiralClass *klass); static void sp_spiral_init (SPSpiral *spiral); -static void sp_spiral_build (SPObject * object, Document * document, Inkscape::XML::Node * repr); +static void sp_spiral_build (SPObject * object, SPDocument * document, Inkscape::XML::Node * repr); static Inkscape::XML::Node *sp_spiral_write (SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags); static void sp_spiral_set (SPObject *object, unsigned int key, const gchar *value); static void sp_spiral_update (SPObject *object, SPCtx *ctx, guint flags); @@ -123,7 +123,7 @@ sp_spiral_init (SPSpiral * spiral) * Virtual build: set spiral properties from corresponding repr. */ static void -sp_spiral_build (SPObject * object, Document * document, Inkscape::XML::Node * repr) +sp_spiral_build (SPObject * object, SPDocument * document, Inkscape::XML::Node * repr) { if (((SPObjectClass *) parent_class)->build) ((SPObjectClass *) parent_class)->build (object, document, repr); -- cgit v1.2.3 From 6c059afd9ecdd6fc153e8e9ce0a9e5817fa3086c Mon Sep 17 00:00:00 2001 From: bulia byak Date: Sat, 22 Aug 2009 21:49:32 +0000 Subject: 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) --- src/sp-spiral.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/sp-spiral.cpp') 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 #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 (); -- cgit v1.2.3