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-path.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/sp-path.cpp') diff --git a/src/sp-path.cpp b/src/sp-path.cpp index 04ad386d9..b6637e9d1 100644 --- a/src/sp-path.cpp +++ b/src/sp-path.cpp @@ -56,7 +56,7 @@ static void sp_path_init(SPPath *path); static void sp_path_finalize(GObject *obj); static void sp_path_release(SPObject *object); -static void sp_path_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); +static void sp_path_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); static void sp_path_set(SPObject *object, unsigned key, gchar const *value); static Inkscape::XML::Node *sp_path_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags); @@ -211,7 +211,7 @@ sp_path_finalize(GObject *obj) * fill & style attributes, markers, and CSS properties. */ static void -sp_path_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) +sp_path_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) { /* Are these calls actually necessary? */ sp_object_read_attr(object, "marker"); -- 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-path.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/sp-path.cpp') diff --git a/src/sp-path.cpp b/src/sp-path.cpp index b6637e9d1..04ad386d9 100644 --- a/src/sp-path.cpp +++ b/src/sp-path.cpp @@ -56,7 +56,7 @@ static void sp_path_init(SPPath *path); static void sp_path_finalize(GObject *obj); static void sp_path_release(SPObject *object); -static void sp_path_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_path_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_path_set(SPObject *object, unsigned key, gchar const *value); static Inkscape::XML::Node *sp_path_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags); @@ -211,7 +211,7 @@ sp_path_finalize(GObject *obj) * fill & style attributes, markers, and CSS properties. */ static void -sp_path_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_path_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { /* Are these calls actually necessary? */ sp_object_read_attr(object, "marker"); -- cgit v1.2.3 From 652e8a65fb563f02f8613b98094056e62f9deaf8 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Wed, 26 Aug 2009 21:57:36 +0000 Subject: fix bug #377958: don't write inkscape:path-effect to plain svg (bzr r8540) --- src/sp-path.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/sp-path.cpp') diff --git a/src/sp-path.cpp b/src/sp-path.cpp index 04ad386d9..a2f0f3169 100644 --- a/src/sp-path.cpp +++ b/src/sp-path.cpp @@ -328,13 +328,15 @@ sp_path_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML: repr->setAttribute("d", NULL); } - SPPath *path = (SPPath *) object; - if ( path->original_curve != NULL ) { - gchar *str = sp_svg_write_path(path->original_curve->get_pathvector()); - repr->setAttribute("inkscape:original-d", str); - g_free(str); - } else { - repr->setAttribute("inkscape:original-d", NULL); + if (flags & SP_OBJECT_WRITE_EXT) { + SPPath *path = (SPPath *) object; + if ( path->original_curve != NULL ) { + gchar *str = sp_svg_write_path(path->original_curve->get_pathvector()); + repr->setAttribute("inkscape:original-d", str); + g_free(str); + } else { + repr->setAttribute("inkscape:original-d", NULL); + } } SP_PATH(shape)->connEndPair.writeRepr(repr); -- cgit v1.2.3 From 4d9b6c156619318ead3205d97a838f310a1f748b Mon Sep 17 00:00:00 2001 From: Josh Andler Date: Wed, 7 Oct 2009 21:09:58 +0000 Subject: Patch by Johan to fix 391368 (bzr r8739) --- src/sp-path.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/sp-path.cpp') diff --git a/src/sp-path.cpp b/src/sp-path.cpp index a2f0f3169..a863c12b4 100644 --- a/src/sp-path.cpp +++ b/src/sp-path.cpp @@ -379,7 +379,7 @@ sp_path_set_transform(SPItem *item, Geom::Matrix const &xform) // Transform the original-d path if this is a valid LPE item, other else the (ordinary) path if (path->original_curve && SP_IS_LPE_ITEM(item) && - sp_lpe_item_has_path_effect(SP_LPE_ITEM(item))) { + sp_lpe_item_has_path_effect_recursive(SP_LPE_ITEM(item))) { path->original_curve->transform(xform); } else { shape->curve->transform(xform); @@ -427,7 +427,7 @@ sp_path_update_patheffect(SPLPEItem *lpeitem, bool write) } else { repr->setAttribute("d", NULL); } - } else { + } else if (!success) { // LPE was unsuccesfull. Read the old 'd'-attribute. if (gchar const * value = repr->attribute("d")) { Geom::PathVector pv = sp_svg_read_pathv(value); @@ -489,7 +489,7 @@ SPCurve* sp_path_get_curve_for_edit (SPPath *path) { if (path->original_curve && SP_IS_LPE_ITEM(path) && - sp_lpe_item_has_path_effect(SP_LPE_ITEM(path))) { + sp_lpe_item_has_path_effect_recursive(SP_LPE_ITEM(path))) { return sp_path_get_original_curve(path); } else { return sp_shape_get_curve( (SPShape *) path ); @@ -504,7 +504,7 @@ const SPCurve* sp_path_get_curve_reference (SPPath *path) { if (path->original_curve && SP_IS_LPE_ITEM(path) && - sp_lpe_item_has_path_effect(SP_LPE_ITEM(path))) { + sp_lpe_item_has_path_effect_recursive(SP_LPE_ITEM(path))) { return path->original_curve; } else { return path->curve; -- cgit v1.2.3 From 4ce34cedc0220cd0dc02433484fa2d09d737a93f Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Mon, 23 Nov 2009 21:14:28 +0000 Subject: work on the lpe group undo bug. it's not solved, but i think LPE code does everything correct now. I think now it's the interplay between undo-system and LPE that bugs. (bzr r8839) --- src/sp-path.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/sp-path.cpp') diff --git a/src/sp-path.cpp b/src/sp-path.cpp index a863c12b4..2120ddd64 100644 --- a/src/sp-path.cpp +++ b/src/sp-path.cpp @@ -320,6 +320,9 @@ sp_path_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML: repr = xml_doc->createElement("svg:path"); } +#ifdef PATH_VERBOSE +g_message("sp_path_write writes 'd' attribute"); +#endif if ( shape->curve != NULL ) { gchar *str = sp_svg_write_path(shape->curve->get_pathvector()); repr->setAttribute("d", str); @@ -411,6 +414,10 @@ sp_path_update_patheffect(SPLPEItem *lpeitem, bool write) SPPath * const path = (SPPath *) lpeitem; Inkscape::XML::Node *repr = SP_OBJECT_REPR(shape); +#ifdef PATH_VERBOSE +g_message("sp_path_update_patheffect"); +#endif + if (path->original_curve && sp_lpe_item_has_path_effect_recursive(lpeitem)) { SPCurve *curve = path->original_curve->copy(); /* if a path does not have an lpeitem applied, then reset the curve to the original_curve. @@ -420,6 +427,9 @@ sp_path_update_patheffect(SPLPEItem *lpeitem, bool write) bool success = sp_lpe_item_perform_path_effect(SP_LPE_ITEM(shape), curve); if (success && write) { // could also do SP_OBJECT(shape)->updateRepr(); but only the d attribute needs updating. +#ifdef PATH_VERBOSE +g_message("sp_path_update_patheffect writes 'd' attribute"); +#endif if ( shape->curve != NULL ) { gchar *str = sp_svg_write_path(shape->curve->get_pathvector()); repr->setAttribute("d", str); -- cgit v1.2.3