vcl/source/outdev/map.cxx |   55 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

New commits:
commit 85cc59ba11f9334e0ed5f277607f5d9d63302856
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Sat Jan 29 20:49:47 2022 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Sun Jan 30 15:37:46 2022 +0100

    Resolves: tdf#147013 transform the control point positions too
    
    Change-Id: Ia73317a79de66778d4b2d0face07ee4c41e328d7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129157
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/vcl/source/outdev/map.cxx b/vcl/source/outdev/map.cxx
index 918d8a5a77df..bb4683f37a19 100644
--- a/vcl/source/outdev/map.cxx
+++ b/vcl/source/outdev/map.cxx
@@ -475,6 +475,9 @@ basegfx::B2DPolygon 
OutputDevice::ImplLogicToDevicePixel(const basegfx::B2DPolyg
     sal_uInt32 nPoints = rLogicPoly.count();
     basegfx::B2DPolygon aPoly(rLogicPoly);
 
+    basegfx::B2DPoint aC1;
+    basegfx::B2DPoint aC2;
+
     if (mbMap)
     {
         for (sal_uInt32 i = 0; i < nPoints; ++i)
@@ -484,7 +487,36 @@ basegfx::B2DPolygon 
OutputDevice::ImplLogicToDevicePixel(const basegfx::B2DPolyg
                                         maMapRes.mnMapScNumX, 
maMapRes.mnMapScDenomX )+mnOutOffX+mnOutOffOrigX,
                                   ImplLogicToPixel( 
rPt.getY()+maMapRes.mnMapOfsY, mnDPIY,
                                         maMapRes.mnMapScNumY, 
maMapRes.mnMapScDenomY )+mnOutOffY+mnOutOffOrigY);
+
+            const bool bC1 = aPoly.isPrevControlPointUsed(i);
+            if (bC1)
+            {
+                const basegfx::B2DPoint aB2DC1(aPoly.getPrevControlPoint(i));
+
+                aC1 = basegfx::B2DPoint(ImplLogicToPixel( 
aB2DC1.getX()+maMapRes.mnMapOfsX, mnDPIX,
+                                            maMapRes.mnMapScNumX, 
maMapRes.mnMapScDenomX )+mnOutOffX+mnOutOffOrigX,
+                                        ImplLogicToPixel( 
aB2DC1.getY()+maMapRes.mnMapOfsY, mnDPIY,
+                                            maMapRes.mnMapScNumY, 
maMapRes.mnMapScDenomY )+mnOutOffY+mnOutOffOrigY);
+            }
+
+            const bool bC2 = aPoly.isNextControlPointUsed(i);
+            if (bC2)
+            {
+                const basegfx::B2DPoint aB2DC2(aPoly.getNextControlPoint(i));
+
+                aC2 = basegfx::B2DPoint(ImplLogicToPixel( 
aB2DC2.getX()+maMapRes.mnMapOfsX, mnDPIX,
+                                            maMapRes.mnMapScNumX, 
maMapRes.mnMapScDenomX )+mnOutOffX+mnOutOffOrigX,
+                                        ImplLogicToPixel( 
aB2DC2.getY()+maMapRes.mnMapOfsY, mnDPIY,
+                                            maMapRes.mnMapScNumY, 
maMapRes.mnMapScDenomY )+mnOutOffY+mnOutOffOrigY);
+            }
+
             aPoly.setB2DPoint(i, aPt);
+
+            if (bC1)
+                aPoly.setPrevControlPoint(i, aC1);
+
+            if (bC2)
+                aPoly.setNextControlPoint(i, aC2);
         }
     }
     else
@@ -493,7 +525,30 @@ basegfx::B2DPolygon 
OutputDevice::ImplLogicToDevicePixel(const basegfx::B2DPolyg
         {
             const basegfx::B2DPoint& rPt = aPoly.getB2DPoint(i);
             basegfx::B2DPoint aPt(rPt.getX() + mnOutOffX, rPt.getY() + 
mnOutOffY);
+
+            const bool bC1 = aPoly.isPrevControlPointUsed(i);
+            if (bC1)
+            {
+                const basegfx::B2DPoint aB2DC1(aPoly.getPrevControlPoint(i));
+
+                aC1 = basegfx::B2DPoint(aB2DC1.getX() + mnOutOffX, 
aB2DC1.getY() + mnOutOffY);
+            }
+
+            const bool bC2 = aPoly.isNextControlPointUsed(i);
+            if (bC2)
+            {
+                const basegfx::B2DPoint aB2DC2(aPoly.getNextControlPoint(i));
+
+                aC1 = basegfx::B2DPoint(aB2DC2.getX() + mnOutOffX, 
aB2DC2.getY() + mnOutOffY);
+            }
+
             aPoly.setB2DPoint(i, aPt);
+
+            if (bC1)
+                aPoly.setPrevControlPoint(i, aC1);
+
+            if (bC2)
+                aPoly.setNextControlPoint(i, aC2);
         }
     }
 

Reply via email to