From df3eb74930491458f97a3328a68bf8526fef3caf Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 2 Dec 2021 14:44:54 +0100 Subject: list set items position with rendering --- src/mgui/widget.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/mgui/widget.c') diff --git a/src/mgui/widget.c b/src/mgui/widget.c index 242174d..f35ff05 100644 --- a/src/mgui/widget.c +++ b/src/mgui/widget.c @@ -36,13 +36,12 @@ void mgui_widget_on_event(mgui_widget *self, mgl_window *window, mgl_event *even } } -void mgui_widget_draw(mgui_widget *self, mgl_window *window) { +mgl_vec2i mgui_widget_draw(mgui_widget *self, mgl_window *window) { switch(self->type) { case MGUI_WIDGET_LIST: - mgui_list_draw(mgui_widget_to_list(self), window); - break; + return mgui_list_draw(mgui_widget_to_list(self), window); case MGUI_WIDGET_BUTTON: - mgui_button_draw(mgui_widget_to_button(self), window); - break; + return mgui_button_draw(mgui_widget_to_button(self), window); } + return (mgl_vec2i){ 0, 0 }; } -- cgit v1.2.3