Browse Source

REVIEWED: `GuiMessagebox()`, better text centering

Ray 3 năm trước cách đây
mục cha
commit
9e51cf9213
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      src/raygui.h

+ 2 - 2
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
     //--------------------------------------------------------------------