mirror of
https://github.com/raysan5/raygui.git
synced 2025-12-25 10:22:33 -05:00
Merge pull request #34 from benbeshara/master
Fixed crash when editing textbox at non-end pos
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@ -33,4 +33,6 @@
|
||||
*.su
|
||||
|
||||
!tools/rGuiLayout/release/win32/rguilayout.exe
|
||||
!tools/rGuiStyler/release/win32/rguistyler.exe
|
||||
!tools/rGuiStyler/release/win32/rguistyler.exe
|
||||
|
||||
.vscode/
|
||||
@ -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