diff options
author | Armin Le Grand <alg@apache.org> | 2013-05-30 09:30:24 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-05-30 14:51:23 +0100 |
commit | 628ed6bc13fd4817c3dc2129e3f226a12a152d99 (patch) | |
tree | 96b020b935d9014ee308ad7b581d40a3d3854fda /drawinglayer | |
parent | 5cae58153113e4e10c30c7bced646574a6709ad9 (diff) |
Resolves: #i122395# Adapted mapping of content to more general way
(cherry picked from commit 525dfeafdb5c9a57cd2d40c9b2358446aa6aabbd)
Change-Id: Iba1af96519e378e3bdccca4295b412563004bab3
Diffstat (limited to 'drawinglayer')
-rw-r--r-- | drawinglayer/source/primitive2d/metafileprimitive2d.cxx | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx index a7abeb66bc0b..3df6c70025ec 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); |