[Libreoffice-commits] core.git: Branch 'aoo/trunk' - vcl/source

Armin Le Grand alg at apache.org
Wed Apr 2 05:07:55 PDT 2014


 vcl/source/gdi/outdev2.cxx |   15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

New commits:
commit d3c4a0c2a87504007a30e6944f52da4654cfa784
Author: Armin Le Grand <alg at apache.org>
Date:   Wed Apr 2 11:21:46 2014 +0000

    i124580 corrected some conversions of scale values to integer positions

diff --git a/vcl/source/gdi/outdev2.cxx b/vcl/source/gdi/outdev2.cxx
index bc892a6..975ff2a6 100644
--- a/vcl/source/gdi/outdev2.cxx
+++ b/vcl/source/gdi/outdev2.cxx
@@ -825,8 +825,11 @@ void OutputDevice::DrawTransformedBitmapEx(
     {
         // with no rotation, shear or mirroring it can be mapped to DrawBitmapEx
         // do *not* execute the mirroring here, it's done in the fallback
+        // #124580# the correct DestSize needs to be calculated based on MaxXY values
         const Point aDestPt(basegfx::fround(aTranslate.getX()), basegfx::fround(aTranslate.getY()));
-        const Size aDestSize(basegfx::fround(aScale.getX()), basegfx::fround(aScale.getY()));
+        const Size aDestSize(
+            basegfx::fround(aScale.getX() + aTranslate.getX()) - aDestPt.X(),
+            basegfx::fround(aScale.getY() + aTranslate.getY()) - aDestPt.Y());
 
         DrawBitmapEx(aDestPt, aDestSize, rBitmapEx);
         return;
@@ -879,8 +882,11 @@ void OutputDevice::DrawTransformedBitmapEx(
         {
             // with no rotation or shear it can be mapped to DrawBitmapEx
             // do *not* execute the mirroring here, it's done in the fallback
+            // #124580# the correct DestSize needs to be calculated based on MaxXY values
             const Point aDestPt(basegfx::fround(aTranslate.getX()), basegfx::fround(aTranslate.getY()));
-            const Size aDestSize(basegfx::fround(aScale.getX()), basegfx::fround(aScale.getY()));
+            const Size aDestSize(
+                basegfx::fround(aScale.getX() + aTranslate.getX()) - aDestPt.X(),
+                basegfx::fround(aScale.getY() + aTranslate.getY()) - aDestPt.Y());
 
             DrawBitmapEx(aDestPt, aDestSize, rBitmapEx);
             return;
@@ -1016,8 +1022,11 @@ void OutputDevice::DrawTransformedBitmapEx(
                     aTargetRange.getMinimum()));
 
             // extract point and size; do not remove size, the bitmap may have been prepared reduced by purpose
+            // #124580# the correct DestSize needs to be calculated based on MaxXY values
             const Point aDestPt(basegfx::fround(aVisibleRange.getMinX()), basegfx::fround(aVisibleRange.getMinY()));
-            const Size aDestSize(basegfx::fround(aVisibleRange.getWidth()), basegfx::fround(aVisibleRange.getHeight()));
+            const Size aDestSize(
+                basegfx::fround(aVisibleRange.getMaxX()) - aDestPt.X(),
+                basegfx::fround(aVisibleRange.getMaxY()) - aDestPt.Y());
 
             DrawBitmapEx(aDestPt, aDestSize, aTransformed);
         }


More information about the Libreoffice-commits mailing list