summaryrefslogtreecommitdiff
path: root/svgio
diff options
context:
space:
mode:
authorBartosz Kosiorek <gang65@poczta.onet.pl>2022-06-12 21:51:52 +0200
committerBartosz Kosiorek <gang65@poczta.onet.pl>2022-06-14 10:30:32 +0200
commit7b12c659842eb53b96dd98ecea65c6071506dfbb (patch)
tree02d96f0f5f2e059fd771351a85ea68819c40f55e /svgio
parent4879f99b824036b3d409ed52f74dc3eb3b4949e4 (diff)
tdf#131506 tdf#143031 EMF+ Fix displaying PathGradient fill
With previous implementation, the EMF+ import is calculating gradient positions wrongly. It is causing warning: SvgGradientHelper got invalid SvgGradientEntries outside [0.0 .. 1.0] and the gradient was not displayed at all. This patch fixes that and gradient is displayed correctly Change-Id: I6229c516165436d0c7ae187d9eb69b5494da396f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135607 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
Diffstat (limited to 'svgio')
-rw-r--r--svgio/qa/cppunit/SvgImportTest.cxx14
1 files changed, 11 insertions, 3 deletions
diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx
index e4f8ffe91a71..4f9ee58f68db 100644
--- a/svgio/qa/cppunit/SvgImportTest.cxx
+++ b/svgio/qa/cppunit/SvgImportTest.cxx
@@ -415,9 +415,13 @@ void Test::testTdf97542_2()
CPPUNIT_ASSERT (pDocument);
- assertXPath(pDocument, "/primitive2D/transform/objectinfo/svgradialgradient[1]", "focusx", "1");
- assertXPath(pDocument, "/primitive2D/transform/objectinfo/svgradialgradient[1]", "focusy", "1");
- assertXPath(pDocument, "/primitive2D/transform/objectinfo/svgradialgradient[1]", "radius", "3");
+ assertXPath(pDocument, "/primitive2D/transform/objectinfo/svgradialgradient", "startx", "1");
+ assertXPath(pDocument, "/primitive2D/transform/objectinfo/svgradialgradient", "starty", "1");
+ assertXPath(pDocument, "/primitive2D/transform/objectinfo/svgradialgradient/focalx", 0);
+ assertXPath(pDocument, "/primitive2D/transform/objectinfo/svgradialgradient/focaly", 0);
+ assertXPath(pDocument, "/primitive2D/transform/objectinfo/svgradialgradient", "radius", "3");
+ assertXPath(pDocument, "/primitive2D/transform/objectinfo/svgradialgradient", "spreadmethod", "pad");
+ assertXPath(pDocument, "/primitive2D/transform/objectinfo/svgradialgradient", "opacity", "1");
}
void Test::testTdf97543()
@@ -741,8 +745,12 @@ void Test::testTdf94765()
CPPUNIT_ASSERT (pDocument);
//Check that both rectangles use the gradient as fill
+ assertXPath(pDocument, "/primitive2D/transform/transform/svglineargradient[1]", "startx", "1");
+ assertXPath(pDocument, "/primitive2D/transform/transform/svglineargradient[1]", "starty", "1");
assertXPath(pDocument, "/primitive2D/transform/transform/svglineargradient[1]", "endx", "2");
assertXPath(pDocument, "/primitive2D/transform/transform/svglineargradient[1]", "endy", "1");
+ assertXPath(pDocument, "/primitive2D/transform/transform/svglineargradient[2]", "startx", "0");
+ assertXPath(pDocument, "/primitive2D/transform/transform/svglineargradient[2]", "starty", "0");
assertXPath(pDocument, "/primitive2D/transform/transform/svglineargradient[2]", "endx", "0");
assertXPath(pDocument, "/primitive2D/transform/transform/svglineargradient[2]", "endy", "0");
}