From 9e51cf9213244bd791894f9708fe70e2d96c14c8 Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 12 Mar 2022 21:26:54 +0100 Subject: [PATCH] REVIEWED: `GuiMessagebox()`, better text centering --- src/raygui.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/raygui.h b/src/raygui.h index 78cc728..de715eb 100644 --- a/src/raygui.h +++ b/src/raygui.h @@ -3055,9 +3055,9 @@ int GuiMessageBox(Rectangle bounds, const char *title, const char *message, cons Rectangle textBounds = { 0 }; textBounds.x = bounds.x + bounds.width/2 - textSize.x/2; - textBounds.y = bounds.y + RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT + (bounds.height - RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT - RAYGUI_MESSAGEBOX_BUTTON_HEIGHT - RAYGUI_MESSAGEBOX_BUTTON_PADDING)/2 - textSize.y/2; + textBounds.y = bounds.y + RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT + RAYGUI_MESSAGEBOX_BUTTON_PADDING; textBounds.width = textSize.x; - textBounds.height = textSize.y; + textBounds.height = bounds.height - RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT - 3*RAYGUI_MESSAGEBOX_BUTTON_PADDING - RAYGUI_MESSAGEBOX_BUTTON_HEIGHT; // Draw control //--------------------------------------------------------------------