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-07 09:10:48 +0100 |
commit | ef7b60c06f2dd50401c213cf9e024757ffee8040 (patch) | |
tree | 213e1a2e79723b0976396a53f744ea14fbff9c5e /vcl | |
parent | f608ca3a3d2b0fc8bb37d2282117e4289a5f076d (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>
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 c5ad78d7a945..bf848462294f 100644 --- a/vcl/source/bitmap/bitmappaint.cxx +++ b/vcl/source/bitmap/bitmappaint.cxx @@ -381,7 +381,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); @@ -389,7 +389,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); @@ -397,8 +397,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++) |