Fix selecting and then pasting text

Now the caret isn't off by 1 character anymore
This commit is contained in:
stefnotch
2021-04-24 10:19:20 +02:00
parent 221c4f0648
commit 37ed8afb30

View File

@@ -504,9 +504,7 @@ namespace FlaxEngine.GUI
if (string.IsNullOrEmpty(clipboardText))
return;
var right = SelectionRight;
Insert(clipboardText);
SetSelection(Mathf.Max(right, 0) + clipboardText.Length);
}
/// <summary>
@@ -626,7 +624,7 @@ namespace FlaxEngine.GUI
_text = _text.Insert(left, str);
SetSelection(left + 1);
SetSelection(left + str.Length);
}
OnTextChanged();