Update raygui.h

This commit is contained in:
Ray
2025-11-25 12:15:44 +01:00
parent 715baf250d
commit 1a74db2ab3

View File

@ -141,7 +141,7 @@
* Draw text bounds rectangles for debug * Draw text bounds rectangles for debug
* *
* VERSIONS HISTORY: * VERSIONS HISTORY:
* 5.0-dev (2025) Current dev version... * 5.0 (xx-Nov-2025) ADDED: Support up to 32 controls (v500)
* ADDED: guiControlExclusiveMode and guiControlExclusiveRec for exclusive modes * ADDED: guiControlExclusiveMode and guiControlExclusiveRec for exclusive modes
* ADDED: GuiValueBoxFloat() * ADDED: GuiValueBoxFloat()
* ADDED: GuiDropdonwBox() properties: DROPDOWN_ARROW_HIDDEN, DROPDOWN_ROLL_UP * ADDED: GuiDropdonwBox() properties: DROPDOWN_ARROW_HIDDEN, DROPDOWN_ROLL_UP
@ -4231,7 +4231,7 @@ int GuiTextInputBox(Rectangle bounds, const char *title, const char *message, co
// Grid control // Grid control
// NOTE: Returns grid mouse-hover selected cell // NOTE: Returns grid mouse-hover selected cell
// About drawing lines at subpixel spacing, simple put, not easy solution: // About drawing lines at subpixel spacing, simple put, not easy solution:
// https://stackoverflow.com/questions/4435450/2d-opengl-drawing-lines-that-dont-exactly-fit-pixel-raster // Ref: https://stackoverflow.com/questions/4435450/2d-opengl-drawing-lines-that-dont-exactly-fit-pixel-raster
int GuiGrid(Rectangle bounds, const char *text, float spacing, int subdivs, Vector2 *mouseCell) int GuiGrid(Rectangle bounds, const char *text, float spacing, int subdivs, Vector2 *mouseCell)
{ {
// Grid lines alpha amount // Grid lines alpha amount
@ -5079,25 +5079,18 @@ static const char **GetTextLines(const char *text, int *count)
int textSize = (int)strlen(text); int textSize = (int)strlen(text);
lines[0] = text; lines[0] = text;
int len = 0;
*count = 1; *count = 1;
//int lineSize = 0; // Stores current line size, not returned
for (int i = 0, k = 0; (i < textSize) && (*count < RAYGUI_MAX_TEXT_LINES); i++) for (int i = 0, k = 0; (i < textSize) && (*count < RAYGUI_MAX_TEXT_LINES); i++)
{ {
if (text[i] == '\n') if (text[i] == '\n')
{ {
//lineSize = len;
k++; k++;
lines[k] = &text[i + 1]; // WARNING: next value is valid? lines[k] = &text[i + 1]; // WARNING: next value is valid?
len = 0;
*count += 1; *count += 1;
} }
else len++;
} }
//lines[*count - 1].size = len;
return lines; return lines;
} }
@ -5873,7 +5866,7 @@ static int TextToInteger(const char *text)
text++; text++;
} }
for (int i = 0; ((text[i] >= '0') && (text[i] <= '9')); ++i) value = value*10 + (int)(text[i] - '0'); for (int i = 0; ((text[i] >= '0') && (text[i] <= '9')); i++) value = value*10 + (int)(text[i] - '0');
return value*sign; return value*sign;
} }