summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authormiklosh <miklosh@users.sourceforge.net>2007-08-19 20:09:08 +0000
committermiklosh <miklosh@users.sourceforge.net>2007-08-19 20:09:08 +0000
commit72ce2149792711d91a122e9f8d83e74bf55d5193 (patch)
tree2ff1e2129fec6567492cf5155905b9b0c7a163c4 /src
parentupdate keys.svg (diff)
downloadinkscape-72ce2149792711d91a122e9f8d83e74bf55d5193.tar.gz
inkscape-72ce2149792711d91a122e9f8d83e74bf55d5193.zip
Remove the clipping path emitted before the 'sh' operator since that same path is filled later
(bzr r3535)
Diffstat (limited to 'src')
-rw-r--r--src/extension/internal/pdfinput/svg-builder.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/extension/internal/pdfinput/svg-builder.cpp b/src/extension/internal/pdfinput/svg-builder.cpp
index d5db5489d..6e5620236 100644
--- a/src/extension/internal/pdfinput/svg-builder.cpp
+++ b/src/extension/internal/pdfinput/svg-builder.cpp
@@ -473,6 +473,27 @@ void SvgBuilder::addShadedFill(GfxShading *shading, double *matrix, GfxPath *pat
_container->appendChild(path_node);
Inkscape::GC::release(path_node);
+
+ // Remove the clipping path emitted before the 'sh' operator
+ int up_walk = 0;
+ Inkscape::XML::Node *node = _container->parent();
+ while( node && node->childCount() == 1 && up_walk < 3 ) {
+ gchar const *clip_path_url = node->attribute("clip-path");
+ if (clip_path_url) {
+ // Obtain clipping path's id from the URL
+ gchar clip_path_id[32];
+ strncpy(clip_path_id, clip_path_url + 5, strlen(clip_path_url) - 6);
+ SPObject *clip_obj = _doc->getObjectById(clip_path_id);
+ if (clip_obj) {
+ clip_obj->deleteObject();
+ node->setAttribute("clip-path", NULL);
+ TRACE(("removed clipping path: %s\n", clip_path_id));
+ }
+ break;
+ }
+ node = node->parent();
+ up_walk++;
+ }
}
/**