summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2016-10-29 15:31:29 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2016-11-05 07:21:52 +0000
commit92d0b2bc79033e8f2cd70c298ad746b38b4eea03 (patch)
treee8afdba69c43fa145c6436e9f2cc7e2eb5994bee /svx
parent610be3d128fe19b2d8458a479005314045eab830 (diff)
tdf#103473: Ensure positive rectangle size
Also remove conversion of both negative scales into rotation, because it is handled by flip; use strict comparison instead of approximate float less because it's correct here, and also because basegfx::fTools::less ultimately uses rtl_math_approxEqual, which description states: attention approxEqual( value!=0.0, 0.0 ) _never_ yields true. Unit test included. Change-Id: Ia878fce360cf8aed539d95f2d4a1a3ad94379978 Reviewed-on: https://gerrit.libreoffice.org/30373 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit 1c708eee636c0cdf3da2ec62849618f3262044bc) Reviewed-on: https://gerrit.libreoffice.org/30378
Diffstat (limited to 'svx')
-rw-r--r--svx/source/svdraw/svdotext.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index 151ff79730da..b7ef71a53cb8 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -1703,17 +1703,17 @@ void SdrTextObj::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const b
double fShearX(0.0);
rMatrix.decompose(aScale, aTranslate, fRotate, fShearX);
- // #i75086# Old DrawingLayer (GeoStat and geometry) does not support holding negative scalings
- // in X and Y which equal a 180 degree rotation. Recognize it and react accordingly
- if(basegfx::fTools::less(aScale.getX(), 0.0) && basegfx::fTools::less(aScale.getY(), 0.0))
+ // flip?
+ bool bFlipX = aScale.getX() < 0.0,
+ bFlipY = aScale.getY() < 0.0;
+ if (bFlipX)
{
aScale.setX(fabs(aScale.getX()));
+ }
+ if (bFlipY)
+ {
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;