From 0a2f9688500c6f228dd5b5a86a9cb796aff302c0 Mon Sep 17 00:00:00 2001 From: bjorn Date: Sat, 9 Oct 2021 03:52:11 -0700 Subject: [PATCH] Fix circle uvs; After changing circle scale from diameter to radius, the uvs broke, since they are calculated from the position. --- src/modules/graphics/graphics.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/graphics/graphics.c b/src/modules/graphics/graphics.c index 5c42cd41..7960a303 100644 --- a/src/modules/graphics/graphics.c +++ b/src/modules/graphics/graphics.c @@ -1062,7 +1062,7 @@ void lovrGraphicsArc(DrawStyle style, ArcMode mode, Material* material, mat4 tra for (int i = 0; i <= segments; i++) { float x = cosf(theta); float y = sinf(theta); - memcpy(vertices, ((float[]) { x, y, 0.f, 0.f, 0.f, 1.f, x + .5f, 1.f - (y + .5f) }), 8 * sizeof(float)); + memcpy(vertices, ((float[]) { x, y, 0.f, 0.f, 0.f, 1.f, (1.f + x) * .5f, (1.f - y) * .5f }), 8 * sizeof(float)); vertices += 8; theta += angleShift; }