summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoren De Cuyper <jorendc@libreoffice.org>2014-07-24 23:08:02 +0200
committerDavid Tardon <dtardon@redhat.com>2014-07-25 15:17:36 +0000
commitdf26763379d4c837db9b400641ca756bb62dea4c (patch)
treef5527a185519cb50d5b5d9f1ed6656197aab5ef3
parent602b4643e0d92a1b8102032652abb2b08c790ec2 (diff)
fdo#48065 SVG: correctly clamp fill-opacity
See W3 test http://www.w3.org/Graphics/SVG/Test/20061213/htmlObjectHarness/full-painting-fill-05-b.html which is also attached to the bug document. This fixes the behavior of the insert > image > from file behavior. The open behavior is already fixed by 79a6e40e6f19a896dbc25640deb3d4507eddad95 Change-Id: I9e3a3755bac25ca596d418c229a78cb23e07d3f3 Reviewed-on: https://gerrit.libreoffice.org/10523 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
-rw-r--r--svgio/source/svgreader/svgstyleattributes.cxx5
1 files changed, 1 insertions, 4 deletions
diff --git a/svgio/source/svgreader/svgstyleattributes.cxx b/svgio/source/svgreader/svgstyleattributes.cxx
index 985283386cb3..21aaaa20db53 100644
--- a/svgio/source/svgreader/svgstyleattributes.cxx
+++ b/svgio/source/svgreader/svgstyleattributes.cxx
@@ -1244,10 +1244,7 @@ namespace svgio
if(readSingleNumber(aContent, aNum))
{
- if(aNum.isPositive())
- {
- setFillOpacity(aNum);
- }
+ setFillOpacity(SvgNumber(basegfx::clamp(aNum.getNumber(), 0.0, 1.0), aNum.getUnit(), aNum.isSet()));
}
break;
}