From e9948256687a767e2e81a5c1aee2fd47942548c2 Mon Sep 17 00:00:00 2001 From: jacekpoz Date: Tue, 13 Aug 2024 14:19:56 +0200 Subject: [PATCH] use w and h for radii in ellipse intersects --- src/ptk_vk/components.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ptk_vk/components.c b/src/ptk_vk/components.c index c96c688..0eb08a9 100644 --- a/src/ptk_vk/components.c +++ b/src/ptk_vk/components.c @@ -138,9 +138,9 @@ inline bool rect_intersects(const PtkRect r, const PtkPos p) { inline bool ellipse_intersects(const PtkEllipse e, const PtkPos p) { const float x = p.x - e.center.x; - const float rx = e.radii.x; + const float rx = e.radii.w; const float y = p.y - e.center.y; - const float ry = e.radii.y; + const float ry = e.radii.h; return ((x * x) / (rx * rx)) + ((y * y) / (ry * ry)) <= 1.0f; }