From c2f6876f1e663c84bc20176ef22e4ed2a460c488 Mon Sep 17 00:00:00 2001 From: akim_kleimenov Date: Sun, 30 Jul 2023 21:47:42 +0300 Subject: [PATCH] Fixed incorrect position of the GuiWindowBox closing icon with the defined RAYGUI_NO_ICONS macro. In the absence of the added check, and disabled icons, the closing icon of the Gui Window Box was to the left of the center, although it should be strictly centered. --- src/raygui.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/raygui.h b/src/raygui.h index 487f056e..fecbd0cb 100644 --- a/src/raygui.h +++ b/src/raygui.h @@ -4482,7 +4482,9 @@ static void GuiDrawText(const char *text, Rectangle bounds, int alignment, Color textSizeX += RAYGUI_ICON_SIZE*guiIconScale; // WARNING: If only icon provided, text could be pointing to EOF character: '\0' +#if !defined(RAYGUI_NO_ICONS) if ((lines[i] != NULL) && (lines[i][0] != '\0')) textSizeX += ICON_TEXT_PADDING; +#endif } // Check guiTextAlign global variables