drawinglayer/source/tools/emfphelperdata.cxx |   18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

New commits:
commit 3bd7f23e1ad74014584ffecb77434ddd5a068d82
Author:     Bartosz Kosiorek <[email protected]>
AuthorDate: Thu Jan 17 13:11:48 2019 +0100
Commit:     Bartosz Kosiorek <[email protected]>
CommitDate: Thu Jan 17 17:08:45 2019 +0100

    tdf#122557 EMF+ Implement Shearing for DrawImage records
    
    Change-Id: If16afb7e56002153c962c32ded2e1dd6edda36fb
    Reviewed-on: https://gerrit.libreoffice.org/66509
    Tested-by: Jenkins
    Reviewed-by: Bartosz Kosiorek <[email protected]>

diff --git a/drawinglayer/source/tools/emfphelperdata.cxx 
b/drawinglayer/source/tools/emfphelperdata.cxx
index 03f23451c492..ee4ba1f6f9b9 100644
--- a/drawinglayer/source/tools/emfphelperdata.cxx
+++ b/drawinglayer/source/tools/emfphelperdata.cxx
@@ -1205,6 +1205,8 @@ namespace emfplushelper
                             ::basegfx::B2DPoint aDstPoint;
                             ::basegfx::B2DSize aDstSize;
 
+                            double fShearX = 0.0;
+                            double fShearY = 0.0;
                             if (type == EmfPlusRecordTypeDrawImagePoints)
                             {
                                 sal_uInt32 aCount;
@@ -1223,6 +1225,8 @@ namespace emfplushelper
 
                                     aDstPoint = ::basegfx::B2DPoint(x1, y1);
                                     aDstSize = ::basegfx::B2DSize(x2 - x1, y3 
- y1);
+                                    fShearX = x3 - x1;
+                                    fShearY = y2 - y1;
                                 }
                                 else
                                 {
@@ -1239,12 +1243,14 @@ namespace emfplushelper
                                 aDstSize = ::basegfx::B2DSize(dw, dh);
                             }
 
-                            // create correct transform matrix
-                            const basegfx::B2DHomMatrix aTransformMatrix = 
maMapTransform * basegfx::utils::createScaleTranslateB2DHomMatrix(
-                                aDstSize.getX(),
-                                aDstSize.getY(),
-                                aDstPoint.getX(),
-                                aDstPoint.getY());
+                            const basegfx::B2DHomMatrix aTransformMatrix = 
maMapTransform *
+                                    basegfx::B2DHomMatrix(
+                                        /* Row 0, Column 0 */ aDstSize.getX(),
+                                        /* Row 0, Column 1 */ fShearX,
+                                        /* Row 0, Column 2 */ aDstPoint.getX(),
+                                        /* Row 1, Column 0 */ fShearY,
+                                        /* Row 1, Column 1 */ aDstSize.getY(),
+                                        /* Row 1, Column 2 */ 
aDstPoint.getY());
 
                             if (image.type == ImageDataTypeBitmap)
                             {
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to