From 7b1d631f64770b0a67cf9f3636c0fa78aa771ed9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Philippe=20Bruy=C3=A8re?= Date: Sat, 20 Nov 2021 07:46:37 +0100 Subject: [PATCH] _get_arc_steps = asinf (1.0f / radius) * 1.5f * sqrtf(radius) --- src/vkvg_context_internal.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vkvg_context_internal.c b/src/vkvg_context_internal.c index e182a24..b813944 100644 --- a/src/vkvg_context_internal.c +++ b/src/vkvg_context_internal.c @@ -223,9 +223,9 @@ float _normalizeAngle(float a) return res; } float _get_arc_step (VkvgContext ctx, float radius) { - float dx = 1, dy = 1; - vkvg_matrix_transform_distance (&ctx->pushConsts.mat, &dx, &dy); - return M_PIF/sqrtf(radius)*0.35f/fmaxf(dx,dy); + if (radius < 3.0f) + return asinf (1.0f / radius) * 0.25f; + return asinf (1.0f / radius) * 1.5f * sqrtf(radius); } void _create_gradient_buff (VkvgContext ctx){ vkvg_buffer_create (ctx->pSurf->dev, -- 2.47.3