From 32d7d918933974873841365aaba0c8156473460a Mon Sep 17 00:00:00 2001 From: Martin Fouilleul Date: Tue, 25 Apr 2023 15:10:05 +0200 Subject: [PATCH] [wip] changed ui_begin_frame() to take explicit canvas size --- src/ui.c | 4 +--- src/ui.h | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/ui.c b/src/ui.c index 8b32a6b..a7399b4 100644 --- a/src/ui.c +++ b/src/ui.c @@ -1395,7 +1395,7 @@ void ui_draw() // frame begin/end //----------------------------------------------------------------------------- -void ui_begin_frame(ui_style* defaultStyle, ui_style_mask defaultMask) +void ui_begin_frame(vec2 size, ui_style* defaultStyle, ui_style_mask defaultMask) { ui_context* ui = ui_get_context(); @@ -1409,8 +1409,6 @@ void ui_begin_frame(ui_style* defaultStyle, ui_style_mask defaultMask) ui->clipStack = 0; ui->z = 0; - vec2 size = mg_canvas_size(); - defaultMask &= UI_STYLE_COLOR | UI_STYLE_BG_COLOR | UI_STYLE_BORDER_COLOR diff --git a/src/ui.h b/src/ui.h index 8eb7aa7..b8f7527 100644 --- a/src/ui.h +++ b/src/ui.h @@ -400,7 +400,7 @@ MP_API ui_context* ui_get_context(void); MP_API void ui_set_context(ui_context* context); MP_API void ui_process_event(mp_event* event); -MP_API void ui_begin_frame(ui_style* defaultStyle, ui_style_mask mask); +MP_API void ui_begin_frame(vec2 size, ui_style* defaultStyle, ui_style_mask mask); MP_API void ui_end_frame(void); MP_API void ui_draw(void);