summaryrefslogtreecommitdiff
path: root/svgio
diff options
context:
space:
mode:
authorXisco Fauli <anistenis@gmail.com>2016-07-19 23:25:14 +0200
committerXisco FaulĂ­ <anistenis@gmail.com>2016-07-20 08:53:39 +0000
commitecb34112cc4c768fd2f57499151920fa7798776f (patch)
treea4d3dbb0bc1a49d3c113c73b6c5715d541128c59 /svgio
parent33f48960c6ce718937767796d39a40344a356956 (diff)
SVGIO: use clamp on strokeOpacity in case it's negative
testcase: painting-stroke-08-t.svg Change-Id: Ia09a4581e5189cbb88aca4391474ada89e7af042 testcase: painting-stroke-08-t.svg Reviewed-on: https://gerrit.libreoffice.org/27326 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Xisco FaulĂ­ <anistenis@gmail.com>
Diffstat (limited to 'svgio')
-rw-r--r--svgio/source/svgreader/svgstyleattributes.cxx6
1 files changed, 2 insertions, 4 deletions
diff --git a/svgio/source/svgreader/svgstyleattributes.cxx b/svgio/source/svgreader/svgstyleattributes.cxx
index 993521c39922..3366ce028557 100644
--- a/svgio/source/svgreader/svgstyleattributes.cxx
+++ b/svgio/source/svgreader/svgstyleattributes.cxx
@@ -1455,14 +1455,12 @@ namespace svgio
}
case SVGTokenStrokeOpacity:
{
+
SvgNumber aNum;
if(readSingleNumber(aContent, aNum))
{
- if(aNum.isPositive())
- {
- setStrokeOpacity(aNum);
- }
+ setStrokeOpacity(SvgNumber(basegfx::clamp(aNum.getNumber(), 0.0, 1.0), aNum.getUnit(), aNum.isSet()));
}
break;
}