From 448e9fed146fa547293a6ce4eb36841a53e26c6f Mon Sep 17 00:00:00 2001 From: jacekpoz Date: Tue, 13 Aug 2024 12:10:48 +0200 Subject: [PATCH] handle button hitboxes properly --- src/ptk_vk/components.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/ptk_vk/components.c b/src/ptk_vk/components.c index c2a3f12..121a227 100644 --- a/src/ptk_vk/components.c +++ b/src/ptk_vk/components.c @@ -85,10 +85,13 @@ void ellipse(const PtkEllipse *ellipse) { } void vk_component(PtkHandle component) { - if ( - component->type == PTK_COMPONENT_TYPE_BOX || - component->type == PTK_COMPONENT_TYPE_CLICKABLE - ) { + if (component->type == PTK_COMPONENT_TYPE_BOX) { + return; + } + + if (component->type == PTK_COMPONENT_TYPE_CLICKABLE) { + PtkClickable *c = (PtkClickable *)component; + vk_component(c->hitbox); return; }