diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2022-01-08 19:06:14 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-01-08 20:45:19 +0100 |
commit | 4c4ce3dc2133199f0d804a686a1e0cd0c9124914 (patch) | |
tree | 2964b3991ff6dde46070425a735829ac20de2c40 /svx | |
parent | 31872a382342060d6e1ecd9168b2a8c7a57d4717 (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>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/svdraw/svdtrans.cxx | 10 |
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) |