From 56c3080b10ab44a585ede8d257c718cc38090173 Mon Sep 17 00:00:00 2001 From: Ruan Lucas <79365912+RuanLucasGD@users.noreply.github.com> Date: Sat, 7 Oct 2023 11:06:23 -0400 Subject: [PATCH 1/2] fix edit text box --- Source/Engine/UI/GUI/Common/TextBoxBase.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Engine/UI/GUI/Common/TextBoxBase.cs b/Source/Engine/UI/GUI/Common/TextBoxBase.cs index 05183d57a..93cdaa917 100644 --- a/Source/Engine/UI/GUI/Common/TextBoxBase.cs +++ b/Source/Engine/UI/GUI/Common/TextBoxBase.cs @@ -769,13 +769,13 @@ namespace FlaxEngine.GUI { SetSelection(SelectionLeft); } - else if (SelectionLeft > 0) + else if (SelectionLeft >= 0) { int position; if (ctrl) position = FindPrevWordBegin(); else - position = _selectionEnd - 1; + position = Mathf.Max(_selectionEnd - 1, 0); if (shift) { @@ -1302,7 +1302,7 @@ namespace FlaxEngine.GUI MoveRight(shiftDown, ctrDown); return true; case KeyboardKeys.ArrowLeft: - MoveLeft(shiftDown, ctrDown); + MoveLeft(shiftDown, ctrDown); return true; case KeyboardKeys.ArrowUp: MoveUp(shiftDown, ctrDown); From 95f40ecc0c62d16fc1e19b5ca83cb6272efb9180 Mon Sep 17 00:00:00 2001 From: Ruan Lucas <79365912+RuanLucasGD@users.noreply.github.com> Date: Sat, 7 Oct 2023 16:27:14 -0400 Subject: [PATCH 2/2] clean code --- Source/Engine/UI/GUI/Common/TextBoxBase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Engine/UI/GUI/Common/TextBoxBase.cs b/Source/Engine/UI/GUI/Common/TextBoxBase.cs index 93cdaa917..c08b59f48 100644 --- a/Source/Engine/UI/GUI/Common/TextBoxBase.cs +++ b/Source/Engine/UI/GUI/Common/TextBoxBase.cs @@ -1302,7 +1302,7 @@ namespace FlaxEngine.GUI MoveRight(shiftDown, ctrDown); return true; case KeyboardKeys.ArrowLeft: - MoveLeft(shiftDown, ctrDown); + MoveLeft(shiftDown, ctrDown); return true; case KeyboardKeys.ArrowUp: MoveUp(shiftDown, ctrDown);