Merge branch 'fix-textbox-bugs' of git://github.com/stefnotch/FlaxEngine into stefnotch-fix-textbox-bugs
This commit is contained in:
@@ -522,9 +522,7 @@ namespace FlaxEngine.GUI
|
||||
if (string.IsNullOrEmpty(clipboardText))
|
||||
return;
|
||||
|
||||
var right = SelectionRight;
|
||||
Insert(clipboardText);
|
||||
SetSelection(Mathf.Max(right, 0) + clipboardText.Length);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -640,11 +638,13 @@ namespace FlaxEngine.GUI
|
||||
{
|
||||
var left = SelectionLeft >= 0 ? SelectionLeft : 0;
|
||||
if (HasSelection)
|
||||
{
|
||||
_text = _text.Remove(left, selectionLength);
|
||||
|
||||
SetSelection(left);
|
||||
}
|
||||
_text = _text.Insert(left, str);
|
||||
|
||||
SetSelection(left + 1);
|
||||
SetSelection(left + str.Length);
|
||||
}
|
||||
|
||||
OnTextChanged();
|
||||
|
||||
Reference in New Issue
Block a user