drawinglayer/source/tools/emfpbrush.cxx      |   18 +++++++++---------
 drawinglayer/source/tools/emfpbrush.hxx      |    2 +-
 drawinglayer/source/tools/emfphelperdata.cxx |    4 ++--
 3 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit 490804ade1103c3fd7569ea093d8d90beab445a3
Author:     Bartosz Kosiorek <gan...@poczta.onet.pl>
AuthorDate: Sun Mar 15 10:38:13 2020 +0100
Commit:     Bartosz Kosiorek <gan...@poczta.onet.pl>
CommitDate: Sun Mar 15 11:38:27 2020 +0100

    tdf#124424 Fix orientation of the LinearGradient
    
    Change-Id: Id0547fcea95306997f8f04d400f3073abb6d6c47
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90514
    Tested-by: Jenkins
    Reviewed-by: Bartosz Kosiorek <gan...@poczta.onet.pl>

diff --git a/drawinglayer/source/tools/emfpbrush.cxx 
b/drawinglayer/source/tools/emfpbrush.cxx
index 892a22d5caa7..f4e57015ca72 100644
--- a/drawinglayer/source/tools/emfpbrush.cxx
+++ b/drawinglayer/source/tools/emfpbrush.cxx
@@ -33,8 +33,8 @@ namespace emfplushelper
         , wrapMode(0)
         , firstPointX(0.0)
         , firstPointY(0.0)
-        , secondPointX(0.0)
-        , secondPointY(0.0)
+        , aWidth(0.0)
+        , aHeight(0.0)
         , hasTransformation(false)
         , blendPoints(0)
         , blendFactors(nullptr)
@@ -156,8 +156,8 @@ namespace emfplushelper
                     s.Seek(pos + pathLength);
 
                     const ::basegfx::B2DRectangle 
aBounds(::basegfx::utils::getRange(path->GetPolygon(rR, false)));
-                    secondPointX = aBounds.getWidth();
-                    secondPointY = aBounds.getHeight();
+                    aWidth = aBounds.getWidth();
+                    aHeight = aBounds.getHeight();
                     SAL_INFO("drawinglayer", "EMF+\t\t\t\tPolygon bounding 
box: " << aBounds.getMinX() << "," << aBounds.getMinY() << " "
                                                                              
<< aBounds.getWidth() << "x" << aBounds.getHeight());
                 }
@@ -174,8 +174,8 @@ namespace emfplushelper
                     s.Seek(pos + 8 * boundaryPointCount);
 
                     const ::basegfx::B2DRectangle 
aBounds(::basegfx::utils::getRange(path->GetPolygon(rR, false)));
-                    secondPointX = aBounds.getWidth();
-                    secondPointY = aBounds.getHeight();
+                    aWidth = aBounds.getWidth();
+                    aHeight = aBounds.getHeight();
                     SAL_INFO("drawinglayer", "EMF+\t\t\t\tPolygon bounding 
box: " << aBounds.getMinX() << "," << aBounds.getMinY() << " "
                                                                              
<< aBounds.getWidth() << "x" << aBounds.getHeight());
                 }
@@ -247,9 +247,9 @@ namespace emfplushelper
             {
                 s.ReadUInt32(additionalFlags).ReadInt32(wrapMode);
                 SAL_INFO("drawinglayer", "EMF+\t\t\t\tLinear gradient, 
additional flags: 0x" << std::hex << additionalFlags << std::dec);
-                
s.ReadFloat(firstPointX).ReadFloat(firstPointY).ReadFloat(secondPointX).ReadFloat(secondPointY);
-                SAL_INFO("drawinglayer", "EMF+\t\t\t\tFirst gradinet point: " 
<< firstPointX << ":" << firstPointY
-                                         << ", second gradient point " << 
secondPointX << ":" << secondPointY);
+                
s.ReadFloat(firstPointX).ReadFloat(firstPointY).ReadFloat(aWidth).ReadFloat(aHeight);
+                SAL_INFO("drawinglayer", "EMF+\t\t\t\tFirst gradient point: " 
<< firstPointX << ":" << firstPointY
+                                         << ", size " << aWidth << "x" << 
aHeight);
                 sal_uInt32 color;
                 s.ReadUInt32(color);
                 solidColor = ::Color(0xff - (color >> 24), (color >> 16) & 
0xff, (color >> 8) & 0xff, color & 0xff);
diff --git a/drawinglayer/source/tools/emfpbrush.hxx 
b/drawinglayer/source/tools/emfpbrush.hxx
index ef5a8a43976a..49706c615898 100644
--- a/drawinglayer/source/tools/emfpbrush.hxx
+++ b/drawinglayer/source/tools/emfpbrush.hxx
@@ -101,7 +101,7 @@ namespace emfplushelper
 
         /* linear gradient */
         sal_Int32 wrapMode;
-        float firstPointX, firstPointY, secondPointX, secondPointY;
+        float firstPointX, firstPointY, aWidth, aHeight;
         ::Color secondColor; // first color is stored in solidColor;
         basegfx::B2DHomMatrix brush_transformation;
         bool hasTransformation;
diff --git a/drawinglayer/source/tools/emfphelperdata.cxx 
b/drawinglayer/source/tools/emfphelperdata.cxx
index 9b16f6af51a3..209063586d62 100644
--- a/drawinglayer/source/tools/emfphelperdata.cxx
+++ b/drawinglayer/source/tools/emfphelperdata.cxx
@@ -878,9 +878,9 @@ namespace emfplushelper
                 if (brush->type == BrushTypeLinearGradient)
                 {
                     // support for public enum EmfPlusWrapMode
-                    basegfx::B2DPoint aStartPoint = Map(brush->firstPointX, 
brush->firstPointY);
+                    basegfx::B2DPoint aStartPoint = Map(brush->firstPointX, 
0.0);
                     aStartPoint = aPolygonTransformation * aStartPoint;
-                    basegfx::B2DPoint aEndPoint = Map(brush->firstPointX + 
brush->secondPointX, brush->firstPointY + brush->secondPointY);
+                    basegfx::B2DPoint aEndPoint = Map(brush->firstPointX + 
brush->aWidth, 0.0);
                     aEndPoint = aPolygonTransformation * aEndPoint;
 
                     // support for public enum EmfPlusWrapMode
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to