svx/source/svdraw/svdtrans.cxx |   10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

New commits:
commit 4c4ce3dc2133199f0d804a686a1e0cd0c9124914
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Sat Jan 8 19:06:14 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sat Jan 8 20:45:19 2022 +0100

    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.gran...@collabora.co.uk>

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)

Reply via email to