[Libreoffice-commits] core.git: drawinglayer/source

Armin Le Grand alg at apache.org
Thu May 30 06:53:07 PDT 2013


 drawinglayer/source/primitive2d/metafileprimitive2d.cxx |   20 +++++++++++-----
 1 file changed, 14 insertions(+), 6 deletions(-)

New commits:
commit 628ed6bc13fd4817c3dc2129e3f226a12a152d99
Author: Armin Le Grand <alg at apache.org>
Date:   Thu May 30 09:30:24 2013 +0000

    Resolves: #i122395# Adapted mapping of content to more general way
    
    (cherry picked from commit 525dfeafdb5c9a57cd2d40c9b2358446aa6aabbd)
    
    Change-Id: Iba1af96519e378e3bdccca4295b412563004bab3

diff --git a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
index a7abeb6..3df6c70 100644
--- a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
@@ -2992,6 +2992,9 @@ namespace
 
                             if(xSubContent.hasElements())
                             {
+                                // prepare sub-content transform
+                                basegfx::B2DHomMatrix aSubTransform;
+
                                 // create SourceRange
                                 const basegfx::B2DRange aSourceRange(
                                     rContent.GetPrefMapMode().GetOrigin().X(),
@@ -3002,17 +3005,22 @@ namespace
                                 // apply mapping if aTargetRange and aSourceRange are not equal
                                 if(!aSourceRange.equal(aTargetRange))
                                 {
-                                    basegfx::B2DHomMatrix aTransform;
-
-                                    aTransform.translate(-aSourceRange.getMinX(), -aSourceRange.getMinY());
-                                    aTransform.scale(
+                                    aSubTransform.translate(-aSourceRange.getMinX(), -aSourceRange.getMinY());
+                                    aSubTransform.scale(
                                         aTargetRange.getWidth() / (basegfx::fTools::equalZero(aSourceRange.getWidth()) ? 1.0 : aSourceRange.getWidth()),
                                         aTargetRange.getHeight() / (basegfx::fTools::equalZero(aSourceRange.getHeight()) ? 1.0 : aSourceRange.getHeight()));
-                                    aTransform.translate(aTargetRange.getMinX(), aTargetRange.getMinY());
+                                    aSubTransform.translate(aTargetRange.getMinX(), aTargetRange.getMinY());
+                                }
 
+                                // apply general current transformation
+                                aSubTransform = rPropertyHolders.Current().getTransformation() * aSubTransform;
+
+                                // evtl. embed sub-content to it's transformation
+                                if(!aSubTransform.isIdentity())
+                                {
                                     const drawinglayer::primitive2d::Primitive2DReference aEmbeddedTransform(
                                         new drawinglayer::primitive2d::TransformPrimitive2D(
-                                            aTransform,
+                                            aSubTransform,
                                             xSubContent));
 
                                     xSubContent = drawinglayer::primitive2d::Primitive2DSequence(&aEmbeddedTransform, 1);


More information about the Libreoffice-commits mailing list