From 91fe6b97952aa6f7cef58327fd085a17db38ad95 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 11:44:47 +0200 Subject: Merging upstream version 4:24.2.2. Signed-off-by: Daniel Baumann --- svgio/source/svgreader/svgstyleattributes.cxx | 38 ++++++++++++++++++++++++++- svgio/source/svgreader/svgtoken.cxx | 1 + 2 files changed, 38 insertions(+), 1 deletion(-) (limited to 'svgio/source') diff --git a/svgio/source/svgreader/svgstyleattributes.cxx b/svgio/source/svgreader/svgstyleattributes.cxx index 731df59aee..19070989bb 100644 --- a/svgio/source/svgreader/svgstyleattributes.cxx +++ b/svgio/source/svgreader/svgstyleattributes.cxx @@ -850,7 +850,8 @@ namespace svgio::svgreader const basegfx::B2DRange aTargetRange(0.0, 0.0, fTargetWidth, fTargetHeight); const SvgAspectRatio& rRatio = rMarker.getSvgAspectRatio(); - if(rRatio.isSet()) + + if(rRatio.isSet() && Overflow::visible != rMarker.getSvgStyleAttributes()->getOverflow()) { // let mapping be created from SvgAspectRatio rMarkerTransform = rRatio.createMapping(aTargetRange, aPrimitiveRange); @@ -1279,6 +1280,7 @@ namespace svgio::svgreader maTextAlign(TextAlign::notset), maTextDecoration(TextDecoration::notset), maTextAnchor(TextAnchor::notset), + maOverflow(Overflow::notset), maVisibility(Visibility::notset), maFillRule(FillRule::notset), maClipRule(FillRule::notset), @@ -1822,6 +1824,21 @@ namespace svgio::svgreader } break; } + case SVGToken::Overflow: + { + if(!aContent.isEmpty()) + { + if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"visible")) + { + setOverflow(Overflow::visible); + } + else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"hidden")) + { + setOverflow(Overflow::hidden); + } + } + break; + } case SVGToken::Visibility: { if(!aContent.isEmpty()) @@ -2316,6 +2333,25 @@ namespace svgio::svgreader return SvgNumber(1.0); } + Overflow SvgStyleAttributes::getOverflow() const + { + if(Overflow::notset != maOverflow) + { + return maOverflow; + } + + if(mrOwner.hasLocalCssStyle()) + { + const SvgStyleAttributes* pSvgStyleAttributes = getParentStyle(); + if (pSvgStyleAttributes) + { + return pSvgStyleAttributes->getOverflow(); + } + } + + return Overflow::hidden; + } + Visibility SvgStyleAttributes::getVisibility() const { if(Visibility::notset == maVisibility || Visibility::inherit == maVisibility) diff --git a/svgio/source/svgreader/svgtoken.cxx b/svgio/source/svgreader/svgtoken.cxx index fa28c8647c..968ead0483 100644 --- a/svgio/source/svgreader/svgtoken.cxx +++ b/svgio/source/svgreader/svgtoken.cxx @@ -110,6 +110,7 @@ constexpr auto aSVGTokenMap = frozen::make_unordered_map