From f60fc766286e3dd94643c6690a8c5adaf3e7fb69 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Wed, 8 Apr 2020 13:11:34 +0200 Subject: [PATCH] drawAnnulusSector fix (0-180) and (0-360) --- radio/src/thirdparty/libopenui/src/bitmapbuffer.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/radio/src/thirdparty/libopenui/src/bitmapbuffer.cpp b/radio/src/thirdparty/libopenui/src/bitmapbuffer.cpp index 16f8bcce6..03543a2cf 100755 --- a/radio/src/thirdparty/libopenui/src/bitmapbuffer.cpp +++ b/radio/src/thirdparty/libopenui/src/bitmapbuffer.cpp @@ -268,14 +268,18 @@ class Slope { explicit Slope(int angle) { if (angle < 0) angle += 360; - if (angle >= 360) + if (angle > 360) angle %= 360; float radians = float(angle) * (M_PI / 180.0f); if (angle == 0) { left = false; value = 100000; } - else if (angle > 180) { + else if (angle == 360) { + left = true; + value = 100000; + } + else if (angle >= 180) { left = true; value = -(cosf(radians) * 100 / sinf(radians)); }