mirror of
https://github.com/raysan5/raygui.git
synced 2025-12-25 10:22:33 -05:00
Fixed crash when editing textbox at non-end pos
This commit is contained in:
@ -2334,7 +2334,7 @@ RAYGUIDEF bool GuiTextBox(Rectangle bounds, char *text, int textSize, bool editM
|
||||
int startIdx = GuiTextBoxGetByteIndex(text, 0, 0, guiTextBoxState.cursor);
|
||||
int endIdx = startIdx + sz;
|
||||
|
||||
if (endIdx <= textSize)
|
||||
if (endIdx <= textSize && length < textSize - 1)
|
||||
{
|
||||
guiTextBoxState.cursor++;
|
||||
guiTextBoxState.select = -1;
|
||||
|
||||
Reference in New Issue
Block a user