diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-01-29 20:49:47 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-01-30 15:37:46 +0100 |
commit | 85cc59ba11f9334e0ed5f277607f5d9d63302856 (patch) | |
tree | 057c71caabe55a6e26f46501c1655f01d9ba32f9 /vcl | |
parent | a03b7d2a8d0f0fd7e710202bbeecf165f0fcd06a (diff) |
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 <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/outdev/map.cxx | 55 |
1 files changed, 55 insertions, 0 deletions
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); } } |