diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2022-02-05 19:01:08 +0100 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2022-02-21 07:19:42 +0100 |
commit | f1385af519ba9e5a6d78f89dcff83f1fd98feb60 (patch) | |
tree | 06c0e6291e5e0e59bc991fc16384bd5f67672497 /vcl | |
parent | 522bde9470bbb321813fa5f1ca8e3c2ebb1bb5cc (diff) |
Fix Bitmap::Rotate
Bug introduced in:
commit 74c46b12340f1afb1752f5df0bab91caca3ef63f
speed up bitmap rotation
it was showing some artifacts in LOK when using previews in rotation
-> sin and cos values were used incorrectly
Change-Id: Id85c54d0aa4488f19e7b5db2e242fdb446626699
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129528
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130233
Tested-by: Jenkins
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/bitmap/bitmappaint.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/vcl/source/bitmap/bitmappaint.cxx b/vcl/source/bitmap/bitmappaint.cxx index 954820c761cc..22a2bfdbd92f 100644 --- a/vcl/source/bitmap/bitmappaint.cxx +++ b/vcl/source/bitmap/bitmappaint.cxx @@ -378,7 +378,7 @@ bool Bitmap::Rotate(Degree10 nAngle10, const Color& rFillColor) for (sal_Int32 nIdx = 0, nX = 0; nX < nNewWidth; nX++) { - const float fTmp = (fXMin + nX) * 64; + const double fTmp = (fXMin + nX) * 64; pCosSinX[nIdx++] = std::round(fCosAngle * fTmp); pCosSinX[nIdx++] = std::round(fSinAngle * fTmp); @@ -386,7 +386,7 @@ bool Bitmap::Rotate(Degree10 nAngle10, const Color& rFillColor) for (sal_Int32 nIdx = 0, nY = 0; nY < nNewHeight; nY++) { - const float fTmp = (fYMin + nY) * 64; + const double fTmp = (fYMin + nY) * 64; pCosSinY[nIdx++] = std::round(fCosAngle * fTmp); pCosSinY[nIdx++] = std::round(fSinAngle * fTmp); @@ -394,8 +394,8 @@ bool Bitmap::Rotate(Degree10 nAngle10, const Color& rFillColor) for (sal_Int32 nCosSinYIdx = 0, nY = 0; nY < nNewHeight; nY++) { - sal_Int32 nSinY = pCosSinY[nCosSinYIdx++]; sal_Int32 nCosY = pCosSinY[nCosSinYIdx++]; + sal_Int32 nSinY = pCosSinY[nCosSinYIdx++]; Scanline pScanline = pWriteAcc->GetScanline(nY); for (sal_Int32 nCosSinXIdx = 0, nX = 0; nX < nNewWidth; nX++) |