summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2022-01-08 19:06:14 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2022-01-10 16:35:11 +0100
commitc9f81fa407f3342e323e648eaaf6c06234fe7376 (patch)
tree5969f1d25290e4b6aa3e5b5057ef9c12cbccc5e7
parenta787ae33c9c3c20043c89893859cafdc45061a3a (diff)
tdf#146556 feature 'drag-mirror' is broken
regression from commit 11e52fe2979b0947814a49b9c17ec373795cbf8e introduce Degree100 strong_int type where I tried to introduce a more efficient NormAngle36000 calculation, but it produces the wrong answer. Change-Id: Iefeb0849984bc59d3ce9191eaf6f064beba94c59 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128143 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit 4c4ce3dc2133199f0d804a686a1e0cd0c9124914) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128151 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r--svx/source/svdraw/svdtrans.cxx10
1 files changed, 4 insertions, 6 deletions
diff --git a/svx/source/svdraw/svdtrans.cxx b/svx/source/svdraw/svdtrans.cxx
index c0a8aa2605f7..2e3b91d47a57 100644
--- a/svx/source/svdraw/svdtrans.cxx
+++ b/svx/source/svdraw/svdtrans.cxx
@@ -405,13 +405,11 @@ Degree100 NormAngle18000(Degree100 a)
return a;
}
-Degree100 NormAngle36000(Degree100 deg100)
+Degree100 NormAngle36000(Degree100 a)
{
- // do an add because we want -90 to end up as 270
- int a = 36000 + deg100.get();
- a %= 36000;
- a = std::abs(a);
- return Degree100(a);
+ while (a < 0_deg100) a += 36000_deg100;
+ while (a >= 36000_deg100) a -= 36000_deg100;
+ return a;
}
sal_uInt16 GetAngleSector(Degree100 nAngle)