From 1db439af43130c9695dbbb661e893d56006bb072 Mon Sep 17 00:00:00 2001 From: miklosh Date: Sun, 19 Aug 2007 20:09:08 +0000 Subject: [PATCH] Remove the clipping path emitted before the 'sh' operator since that same path is filled later --- .../internal/pdfinput/svg-builder.cpp | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) 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++; + } } /** -- 2.30.2