diff --git a/src/ptk.c b/src/ptk.c index f34359d..125ad86 100644 --- a/src/ptk.c +++ b/src/ptk.c @@ -188,10 +188,11 @@ PtkHandle ptk_circle(PtkPos center, float radius, PtkColor color) { PtkHandle ptk_clickable(PtkHandle hitbox, MouseButtonCallback on_press) { PtkClickable *ret = malloc(sizeof(PtkClickable)); - ret->type = PTK_COMPONENT_TYPE_CLICKABLE; - ret->children.size = 0; - ret->hitbox = hitbox; - ret->on_press = on_press; + *ret = (PtkClickable){ + .type = PTK_COMPONENT_TYPE_CLICKABLE, + .hitbox = hitbox, + .on_press = on_press, + }; return (PtkHandle)ret; }