From ef9ec465f7385a178ecde098bd283a7bb9c0302a Mon Sep 17 00:00:00 2001 From: johanengelen Date: Sat, 30 Sep 2006 16:29:24 +0000 Subject: [PATCH] Patch by Popolon to fix bug "[ 1562520 ] Object to path removes mask & clip-path" --- src/path-chemistry.cpp | 11 +++++++++++ src/splivarot.cpp | 15 +++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/src/path-chemistry.cpp b/src/path-chemistry.cpp index 0c35020b7..1415f85e6 100644 --- a/src/path-chemistry.cpp +++ b/src/path-chemistry.cpp @@ -329,6 +329,17 @@ sp_selected_item_to_curved_repr(SPItem *item, guint32 text_grouping_policy) SP_OBJECT_STYLE(SP_OBJECT_PARENT(item))); repr->setAttribute("style", style_str); g_free(style_str); + + /* Mask */ + gchar *mask_str = (gchar *) SP_OBJECT_REPR(item)->attribute("mask"); + if ( mask_str ) + repr->setAttribute("mask", mask_str); + + /* Clip path */ + gchar *clip_path_str = (gchar *) SP_OBJECT_REPR(item)->attribute("clip-path"); + if ( clip_path_str ) + repr->setAttribute("clip-path", clip_path_str); + /* Rotation center */ sp_repr_set_attr(repr, "inkscape:transform-center-x", SP_OBJECT_REPR(item)->attribute("inkscape:transform-center-x")); sp_repr_set_attr(repr, "inkscape:transform-center-y", SP_OBJECT_REPR(item)->attribute("inkscape:transform-center-y")); diff --git a/src/splivarot.cpp b/src/splivarot.cpp index 2fd01cb69..242cf3a24 100644 --- a/src/splivarot.cpp +++ b/src/splivarot.cpp @@ -1408,6 +1408,8 @@ sp_selected_path_simplify_item(SPDesktop *desktop, sp_item_write_transform(item, SP_OBJECT_REPR(item), NR::identity()); gchar *style = g_strdup(SP_OBJECT_REPR(item)->attribute("style")); + gchar *mask = g_strdup(SP_OBJECT_REPR(item)->attribute("mask")); + gchar *clip_path = g_strdup(SP_OBJECT_REPR(item)->attribute("clip-path")); Path *orig = Path_for_item(item, false); if (orig == NULL) { @@ -1439,8 +1441,21 @@ sp_selected_path_simplify_item(SPDesktop *desktop, Inkscape::XML::Node *repr = sp_repr_new("svg:path"); + // restore style, mask and clip-path repr->setAttribute("style", style); + g_free(style); + + if ( mask ) { + repr->setAttribute("mask", mask); + g_free(mask); + } + + if ( clip_path ) { + repr->setAttribute("clip-path", clip_path); + g_free(clip_path); + } + // path gchar *str = orig->svg_dump_path(); repr->setAttribute("d", str); g_free(str); -- 2.30.2