Merge pull request #34 from benbeshara/master

Fixed crash when editing textbox at non-end pos
This commit is contained in:
Ray 2019-06-04 13:40:30 +02:00 committed by GitHub
commit f9a7f29889
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

2
.gitignore vendored
View File

@ -34,3 +34,5 @@
!tools/rGuiLayout/release/win32/rguilayout.exe
!tools/rGuiStyler/release/win32/rguistyler.exe
.vscode/

View File

@ -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;