diff options
Diffstat (limited to 'svgio/source/svgreader')
-rw-r--r-- | svgio/source/svgreader/svgstyleattributes.cxx | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/svgio/source/svgreader/svgstyleattributes.cxx b/svgio/source/svgreader/svgstyleattributes.cxx index 2ae8a06054a4..1f592e7d73d7 100644 --- a/svgio/source/svgreader/svgstyleattributes.cxx +++ b/svgio/source/svgreader/svgstyleattributes.cxx @@ -263,6 +263,9 @@ namespace svgio // dismantle to geometry and add needed primitives const basegfx::BColor* pFill = getFill(); const SvgGradientNode* pFillGradient = getSvgGradientNodeFill(); + const SvgStyleAttributes* pSvgStyleAttributes = getParentStyle(); + const SvgGradientNode* pParentFillGradient = + pSvgStyleAttributes ? pSvgStyleAttributes->getSvgGradientNodeFill() : nullptr; const SvgPatternNode* pFillPattern = getSvgPatternNodeFill(); const basegfx::BColor* pStroke = getStroke(); const SvgGradientNode* pStrokeGradient = getSvgGradientNodeStroke(); @@ -303,20 +306,20 @@ namespace svgio const bool bStrokeUsed(pStroke || pStrokeGradient || pStrokePattern); + if(pFill && (!pFillGradient || pParentFillGradient)) + { + // add the already prepared primitives for single color fill + rTarget.append(rSource); + } // add fill. Use geometry even for simple color fill when stroke // is used, else text rendering and the geometry-based stroke will // normally not really match optically due to diverse system text // renderers - if(aMergedArea.count() && (pFillGradient || pFillPattern || bStrokeUsed)) + else if(aMergedArea.count() && (pFillGradient || pFillPattern || bStrokeUsed)) { // create text fill content based on geometry add_fill(aMergedArea, rTarget, aMergedArea.getB2DRange()); } - else if(pFill) - { - // add the already prepared primitives for single color fill - rTarget.append(rSource); - } // add stroke if(aMergedArea.count() && bStrokeUsed) |