summaryrefslogtreecommitdiffstats
path: root/svgio/source/svgreader
diff options
context:
space:
mode:
Diffstat (limited to 'svgio/source/svgreader')
-rw-r--r--svgio/source/svgreader/svgstyleattributes.cxx38
-rw-r--r--svgio/source/svgreader/svgtoken.cxx1
2 files changed, 38 insertions, 1 deletions
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<std::u16string_view, SV
{ u"visibility", SVGToken::Visibility },
{ u"title", SVGToken::Title },
{ u"desc", SVGToken::Desc },
+ { u"overflow", SVGToken::Overflow },
{ u"preserveAspectRatio", SVGToken::PreserveAspectRatio },
{ u"defer", SVGToken::Defer },
{ u"none", SVGToken::None },