From 4c5df56ca654cf4034ccf468beeea59160ebc72a Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Sat, 19 Dec 2020 15:03:12 +1100 Subject: [PATCH] Mobile: Fix changing touch scale not updating immediately --- src/Gui.c | 4 ++-- src/Gui.h | 2 +- src/Menus.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Gui.c b/src/Gui.c index e4608c0b8..83a7a75fc 100644 --- a/src/Gui.c +++ b/src/Gui.c @@ -119,7 +119,8 @@ static void OnContextRecreated(void* obj) { } } -static void OnResize(void* obj) { +static void OnResize(void* obj) { Gui_LayoutAll(); } +void Gui_LayoutAll(void) { struct Screen* s; int i; @@ -140,7 +141,6 @@ void Gui_RemoveAll(void) { while (Gui.ScreensCount) Gui_Remove(Gui_Screens[0]); } -void Gui_RefreshChat(void) { Gui_Refresh((struct Screen*)Gui_Chat); } void Gui_Refresh(struct Screen* s) { s->VTABLE->ContextLost(s); s->VTABLE->ContextRecreated(s); diff --git a/src/Gui.h b/src/Gui.h index 1b701fc11..0fb6f5502 100644 --- a/src/Gui.h +++ b/src/Gui.h @@ -213,9 +213,9 @@ struct Screen* Gui_GetBlocksWorld(void); /* Returns highest priority screen that is closable. */ struct Screen* Gui_GetClosable(void); +void Gui_LayoutAll(void); void Gui_RefreshAll(void); void Gui_RemoveAll(void); -void Gui_RefreshChat(void); void Gui_Refresh(struct Screen* s); void Gui_RenderGui(double delta); diff --git a/src/Menus.c b/src/Menus.c index d5f3b37be..22624775a 100644 --- a/src/Menus.c +++ b/src/Menus.c @@ -2762,7 +2762,7 @@ void GraphicsOptionsScreen_Show(void) { static void ChatOptionsScreen_SetScale(const cc_string* v, float* target, const char* optKey) { *target = Menu_Float(v); Options_Set(optKey, v); - Gui_RefreshChat(); + Gui_LayoutAll(); } static void ChatOptionsScreen_GetChatScale(cc_string* v) { String_AppendFloat(v, Gui.RawChatScale, 1); }