mirror of
https://github.com/raysan5/raygui.git
synced 2026-01-31 11:19:18 -05:00
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
|
*.su
|
||||||
|
|
||||||
!tools/rGuiLayout/release/win32/rguilayout.exe
|
!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 startIdx = GuiTextBoxGetByteIndex(text, 0, 0, guiTextBoxState.cursor);
|
||||||
int endIdx = startIdx + sz;
|
int endIdx = startIdx + sz;
|
||||||
|
|
||||||
if (endIdx <= textSize)
|
if (endIdx <= textSize && length < textSize - 1)
|
||||||
{
|
{
|
||||||
guiTextBoxState.cursor++;
|
guiTextBoxState.cursor++;
|
||||||
guiTextBoxState.select = -1;
|
guiTextBoxState.select = -1;
|
||||||
|
|||||||
Reference in New Issue
Block a user