diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-12-02 14:44:54 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-12-02 14:44:54 +0100 |
commit | df3eb74930491458f97a3328a68bf8526fef3caf (patch) | |
tree | 129dbc6e6d1c7c65af25d13427f92c45271f433e /src/mgui/button.c | |
parent | 14770f42df291753a240def91fb488a904a909c1 (diff) |
list set items position with rendering
Diffstat (limited to 'src/mgui/button.c')
-rw-r--r-- | src/mgui/button.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mgui/button.c b/src/mgui/button.c index d8d0c58..c6b65d5 100644 --- a/src/mgui/button.c +++ b/src/mgui/button.c @@ -47,9 +47,10 @@ void mgui_button_on_event(mgui_button *self, mgl_window *window, mgl_event *even } } -void mgui_button_draw(mgui_button *self, mgl_window *window) { +mgl_vec2i mgui_button_draw(mgui_button *self, mgl_window *window) { (void)window; self->background.size = mgl_text_get_bounds(&self->label); mgl_rectangle_draw(mgl_get_context(), &self->background); mgl_text_draw(mgl_get_context(), &self->label); + return (mgl_vec2i){ self->background.size.x, self->background.size.y }; } |