3 Commits

Author SHA1 Message Date
Ray
96f2970cf6 Update raygui.h 2026-07-11 17:01:48 +02:00
697cb10936 Fix MSVC compiling on cpp (#565) 2026-07-11 12:57:03 +02:00
Ray
5cc802fd9e Update raygui.h 2026-07-03 11:34:08 +02:00

View File

@ -3231,9 +3231,6 @@ int GuiValueBoxFloat(Rectangle bounds, const char *text, char *textValue, float
int result = 0;
GuiState state = guiState;
//char textValue[RAYGUI_VALUEBOX_MAX_CHARS + 1] = "\0";
//snprintf(textValue, sizeof(textValue), "%2.2f", *value);
Rectangle textBounds = { 0 };
if (text != NULL)
{
@ -4513,7 +4510,7 @@ void GuiLoadStyle(const char *fileName)
sscanf(buffer, "f %d %s %[^\r\n]s", &fontSize, charmapFileName, fontFileName);
// GLOBAL: Copy font file name into guiFontName
strncpy(guiFontName, fontFileName, 31);
snprintf(guiFontName, 32, "%s", fontFileName);
Font font = { 0 };
int *codepoints = NULL;
@ -5164,9 +5161,9 @@ void GuiDrawIcon(int iconId, int posX, int posY, int pixelSize, Color color)
Rectangle srcRec = { (float)x*(RAYGUI_ICON_SIZE + 2*RAYGUI_ICON_FONT_ATLAS_PADDING) + RAYGUI_ICON_FONT_ATLAS_PADDING,
guiIconFontOffsetY + (float)y*(RAYGUI_ICON_SIZE + 2*RAYGUI_ICON_FONT_ATLAS_PADDING) + RAYGUI_ICON_FONT_ATLAS_PADDING,
RAYGUI_ICON_SIZE, RAYGUI_ICON_SIZE };
Rectangle dstRec = { posX, posY, RAYGUI_ICON_SIZE*pixelSize, RAYGUI_ICON_SIZE*pixelSize };
Rectangle dstRec = { (float)posX, (float)posY, (float)pixelSize*RAYGUI_ICON_SIZE, (float)pixelSize*RAYGUI_ICON_SIZE };
DrawTexturePro(guiFont.texture, srcRec, dstRec, (Vector2){ 0, 0 }, 0.0f, color);
DrawTexturePro(guiFont.texture, srcRec, dstRec, RAYGUI_CLITERAL(Vector2){ 0, 0 }, 0.0f, color);
}
else
{
@ -5891,7 +5888,7 @@ static int GuiFontIconBaking(Image *imFont, Font font, Rectangle *whiteRec)
for (int x = 0; x < 3; x++)
((unsigned short *)newImData)[(imFont->height - y - 1)*imFont->width + imFont->width - x - 1] = 0xffff;
*whiteRec = (Rectangle){ imFont->width - 2, imFont->height - 2, 1, 1 };
*whiteRec = RAYGUI_CLITERAL(Rectangle){ (float)imFont->width - 2, (float)imFont->height - 2, 1, 1 };
}
// Calculate image offset positions to start drawing
@ -6166,7 +6163,8 @@ static const char *TextFormat(const char *text, ...)
#define RAYGUI_TEXTFORMAT_MAX_SIZE 256
#endif
static char buffer[RAYGUI_TEXTFORMAT_MAX_SIZE];
static char buffer[RAYGUI_TEXTFORMAT_MAX_SIZE] = { 0 };
memset(buffer, 0, RAYGUI_TEXTFORMAT_MAX_SIZE);
va_list args;
va_start(args, text);