From 0198b3a9451700d875c1b389d30e1a0cc9ab4b47 Mon Sep 17 00:00:00 2001 From: Joren De Cuyper Date: Thu, 24 Jul 2014 23:08:02 +0200 Subject: 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/10522 Reviewed-by: David Tardon Tested-by: David Tardon --- svgio/source/svgreader/svgstyleattributes.cxx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'svgio') diff --git a/svgio/source/svgreader/svgstyleattributes.cxx b/svgio/source/svgreader/svgstyleattributes.cxx index cece3967efdc..4d9448a5491f 100644 --- a/svgio/source/svgreader/svgstyleattributes.cxx +++ b/svgio/source/svgreader/svgstyleattributes.cxx @@ -1246,10 +1246,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; } -- cgit