incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1240097 - /incubator/ooo/trunk/main/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx
Date Fri, 03 Feb 2012 11:57:59 GMT
Author: alg
Date: Fri Feb  3 11:57:58 2012
New Revision: 1240097

URL: http://svn.apache.org/viewvc?rev=1240097&view=rev
Log:
#118824# coreccted mirroring and boundrect when the graphicmanager is used for bitmap output

Modified:
    incubator/ooo/trunk/main/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx

Modified: incubator/ooo/trunk/main/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx?rev=1240097&r1=1240096&r2=1240097&view=diff
==============================================================================
--- incubator/ooo/trunk/main/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx (original)
+++ incubator/ooo/trunk/main/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx Fri
Feb  3 11:57:58 2012
@@ -52,9 +52,9 @@ namespace drawinglayer
 		rTransform.decompose(aScale, aTranslate, fRotate, fShearX);
 
 		// mirror flags
-		aAttributes.SetMirrorFlags(
-			(basegfx::fTools::less(aScale.getX(), 0.0) ? BMP_MIRROR_HORZ : 0)|
-			(basegfx::fTools::less(aScale.getY(), 0.0) ? BMP_MIRROR_VERT : 0));
+        const bool bMirrorX(basegfx::fTools::less(aScale.getX(), 0.0));
+        const bool bMirrorY(basegfx::fTools::less(aScale.getY(), 0.0));
+		aAttributes.SetMirrorFlags((bMirrorX ? BMP_MIRROR_HORZ : 0)|(bMirrorY ? BMP_MIRROR_VERT
: 0));
 
 		// rotation
 		if(!basegfx::fTools::equalZero(fRotate))
@@ -73,9 +73,13 @@ namespace drawinglayer
 		else
 		{
 			// if rotated, create the unrotated output rectangle for the GraphicManager paint
-			const basegfx::B2DHomMatrix aSimpleObjectMatrix(basegfx::tools::createScaleTranslateB2DHomMatrix(
-				fabs(aScale.getX()), fabs(aScale.getY()),
-				aTranslate.getX(), aTranslate.getY()));
+            // #118824# Caution! When mirrored, adapt transformation accordingly
+			const basegfx::B2DHomMatrix aSimpleObjectMatrix(
+                basegfx::tools::createScaleTranslateB2DHomMatrix(
+				    fabs(aScale.getX()), 
+                    fabs(aScale.getY()),
+				    bMirrorX ? aTranslate.getX() - fabs(aScale.getX()): aTranslate.getX(), 
+                    bMirrorY ? aTranslate.getY() - fabs(aScale.getY()): aTranslate.getY()));
 
 			aOutlineRange.transform(aSimpleObjectMatrix);
 		}



Mime
View raw message