From 3e1162bb9a099bea1f8a6345917bb9534cb8dd3f Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 6 Sep 2021 00:24:39 +0200 Subject: [PATCH] Review breaking changes from PRs --- src/raygui.h | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/raygui.h b/src/raygui.h index 56f22a9..00be0f4 100644 --- a/src/raygui.h +++ b/src/raygui.h @@ -1323,13 +1323,7 @@ void GuiGroupBox(Rectangle bounds, const char *text) GuiDrawRectangle(RAYGUI_CLITERAL(Rectangle){ bounds.x, bounds.y + bounds.height - 1, bounds.width, GROUPBOX_LINE_THICK }, 0, BLANK, Fade(GetColor(GuiGetStyle(DEFAULT, (state == GUI_STATE_DISABLED)? BORDER_COLOR_DISABLED : LINE_COLOR)), guiAlpha)); GuiDrawRectangle(RAYGUI_CLITERAL(Rectangle){ bounds.x + bounds.width - 1, bounds.y, GROUPBOX_LINE_THICK, bounds.height }, 0, BLANK, Fade(GetColor(GuiGetStyle(DEFAULT, (state == GUI_STATE_DISABLED)? BORDER_COLOR_DISABLED : LINE_COLOR)), guiAlpha)); - int borderWidthTemp = GuiGetStyle(DEFAULT, BORDER_WIDTH); - - GuiSetStyle(DEFAULT, BORDER_WIDTH, 1); - // Draw split top line with text - GuiLine(RAYGUI_CLITERAL(Rectangle) { bounds.x, bounds.y, bounds.width, 1 }, text); - - GuiSetStyle(DEFAULT, BORDER_WIDTH, borderWidthTemp); + GuiLine(RAYGUI_CLITERAL(Rectangle){ bounds.x, bounds.y, bounds.width, 1 }, text); //-------------------------------------------------------------------- } @@ -1793,13 +1787,16 @@ int GuiComboBox(Rectangle bounds, const char *text, int active) GuiDrawText(items[active], GetTextBounds(COMBOBOX, bounds), GuiGetStyle(COMBOBOX, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(COMBOBOX, TEXT + (state*3))), guiAlpha)); // Draw selector using a custom button - // NOTE: TEXT_ALIGNMENT forced value + // NOTE: BORDER_WIDTH and TEXT_ALIGNMENT forced values + int tempBorderWidth = GuiGetStyle(BUTTON, BORDER_WIDTH); int tempTextAlign = GuiGetStyle(BUTTON, TEXT_ALIGNMENT); + GuiSetStyle(BUTTON, BORDER_WIDTH, 1); GuiSetStyle(BUTTON, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_CENTER); GuiButton(selector, TextFormat("%i/%i", active + 1, itemCount)); GuiSetStyle(BUTTON, TEXT_ALIGNMENT, tempTextAlign); + GuiSetStyle(BUTTON, BORDER_WIDTH, tempBorderWidth); //-------------------------------------------------------------------- return active;