summaryrefslogtreecommitdiff
path: root/svgio
diff options
context:
space:
mode:
authorXisco Fauli <anistenis@gmail.com>2016-07-19 23:25:14 +0200
committerCaolán McNamara <caolanm@redhat.com>2016-07-22 10:41:53 +0000
commit4bb2f539b1d6e806ac992d142d5af0e44958a798 (patch)
tree3bba6bcf4519262a9759f1c2bec3b8415d256633 /svgio
parentaafdbb7763b939742050159ce784b799f26eb834 (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> (cherry picked from commit ecb34112cc4c768fd2f57499151920fa7798776f) Reviewed-on: https://gerrit.libreoffice.org/27346 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.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 8be96e634dee..1e8810b5953f 100644
--- a/svgio/source/svgreader/svgstyleattributes.cxx
+++ b/svgio/source/svgreader/svgstyleattributes.cxx
@@ -1434,14 +1434,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;
}