소스 검색

Fixed incorrect position of the GuiWindowBox closing icon with the defined RAYGUI_NO_ICONS macro. (#318)

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.
Akim 2 년 전
부모
커밋
f8966405ac
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      src/raygui.h

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