summaryrefslogtreecommitdiff
path: root/svx/source/svdraw/svdotext.cxx
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2015-11-22 16:04:36 +1000
committerMike Kaganski <mikekaganski@hotmail.com>2015-11-24 13:46:49 +0000
commitae0e830f9ace78b889713e7e74ce46f88fa21470 (patch)
treed8799369cc9459bf100a3e949616666626ed54e3 /svx/source/svdraw/svdotext.cxx
parentccd04a5f46c491d50b071cf2a58b77a2bacb1922 (diff)
tdf#95970: Don't loose mirroring in SdrTextObj::TRSetBaseGeometry
Currently, negative scaling (mirroring) is lost in SdrTextObj::NbcSetSnapRect, when rect is justified. This patch cares for this. Possibly it's better to make these changes directly in SdrTextObj::NbcSetSnapRect? Change-Id: I353ff01626e15b398de95e28eae78572991dfdc3 Reviewed-on: https://gerrit.libreoffice.org/20109 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
Diffstat (limited to 'svx/source/svdraw/svdotext.cxx')
-rw-r--r--svx/source/svdraw/svdotext.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index 6de973428c77..0159d382326a 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -1722,6 +1722,9 @@ void SdrTextObj::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const b
aScale.setY(fabs(aScale.getY()));
fRotate = fmod(fRotate + F_PI, F_2PI);
}
+ // flip?
+ bool bFlipX = basegfx::fTools::less(aScale.getX(), 0.0),
+ bFlipY = basegfx::fTools::less(aScale.getY(), 0.0);
// reset object shear and rotations
aGeo.nRotationAngle = 0;
@@ -1769,6 +1772,16 @@ void SdrTextObj::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const b
Rectangle aBaseRect(aPoint, aSize);
SetSnapRect(aBaseRect);
+ // flip?
+ if (bFlipX)
+ {
+ Mirror(Point(), Point(0, 1));
+ }
+ if (bFlipY)
+ {
+ Mirror(Point(), Point(1, 0));
+ }
+
// shear?
if(!basegfx::fTools::equalZero(fShearX))
{