vcl/source/gdi/outdev2.cxx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
New commits: commit 10fef58379630c9d8e8ba76258baee917959e7c5 Author: Tomaž Vajngerl <tomaz.vajng...@collabora.com> Date: Wed Apr 30 16:46:40 2014 +0200 fdo#77126 BitmapEx.Scale already takes care of mirroring Change-Id: I320a5ec1da62cc1a8b3cb227298ecaf99f305a6f Signed-off-by: Andras Timar <andras.ti...@collabora.com> diff --git a/vcl/source/gdi/outdev2.cxx b/vcl/source/gdi/outdev2.cxx index 8ec9c21..48ec303 100644 --- a/vcl/source/gdi/outdev2.cxx +++ b/vcl/source/gdi/outdev2.cxx @@ -1010,12 +1010,16 @@ void OutputDevice::ImplDrawBitmapEx( const Point& rDestPt, const Size& rDestSize // we have beautiful scaling algorithms, let's use them if (aDestSizePixel != rSrcSizePixel && rSrcSizePixel.Width() != 0 && rSrcSizePixel.Height() != 0) { - double fScaleX = double(aDestSizePixel.Width()) / rSrcSizePixel.Width(); - double fScaleY = double(aDestSizePixel.Height()) / rSrcSizePixel.Height(); + double fScaleX = std::abs(aDestSizePixel.Width() / double(rSrcSizePixel.Width())); + double fScaleY = std::abs(aDestSizePixel.Height() / double(rSrcSizePixel.Height())); aScaledBitmapEx.Scale(fScaleX, fScaleY); - aSrcSizePixel = aDestSizePixel; + // Negative size values are used for mirroring, but Scale already takes + // care of mirroring so convert all negative values to positive. + aSrcSizePixel = Size(std::abs(aDestSizePixel.Width()), + std::abs(aDestSizePixel.Height())); + aSrcPtPixel.X() = rSrcPtPixel.X() * fScaleX; aSrcPtPixel.Y() = rSrcPtPixel.Y() * fScaleY; }
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits