From: Jean-Philippe Bruyère Date: Mon, 15 Nov 2021 15:09:19 +0000 (+0100) Subject: debug _normalizeAngle X-Git-Tag: v0.2.0~59^2~1 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=4ddd8e413a9e32cd59cef6983e4c430cacbadc4a;p=jp%2Fvkvg.git debug _normalizeAngle --- diff --git a/src/vkvg_context_internal.c b/src/vkvg_context_internal.c index c005f7b..e182a24 100644 --- a/src/vkvg_context_internal.c +++ b/src/vkvg_context_internal.c @@ -217,11 +217,10 @@ void _add_point (VkvgContext ctx, float x, float y){ } float _normalizeAngle(float a) { - float res = ROUND_DOWN(fmodf(a,2.0f*M_PIF),100); + float res = ROUND_DOWN(fmodf(a, 2.0f * M_PIF), 100); if (res < 0.0f) - return res + 2.0f*M_PIF; - else - return res; + res += 2.0f * M_PIF; + return res; } float _get_arc_step (VkvgContext ctx, float radius) { float dx = 1, dy = 1;