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))
|
if (string.IsNullOrEmpty(clipboardText))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var right = SelectionRight;
|
|
||||||
Insert(clipboardText);
|
Insert(clipboardText);
|
||||||
SetSelection(Mathf.Max(right, 0) + clipboardText.Length);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -640,11 +638,13 @@ namespace FlaxEngine.GUI
|
|||||||
{
|
{
|
||||||
var left = SelectionLeft >= 0 ? SelectionLeft : 0;
|
var left = SelectionLeft >= 0 ? SelectionLeft : 0;
|
||||||
if (HasSelection)
|
if (HasSelection)
|
||||||
|
{
|
||||||
_text = _text.Remove(left, selectionLength);
|
_text = _text.Remove(left, selectionLength);
|
||||||
|
SetSelection(left);
|
||||||
|
}
|
||||||
_text = _text.Insert(left, str);
|
_text = _text.Insert(left, str);
|
||||||
|
|
||||||
SetSelection(left + 1);
|
SetSelection(left + str.Length);
|
||||||
}
|
}
|
||||||
|
|
||||||
OnTextChanged();
|
OnTextChanged();
|
||||||
|
|||||||
Reference in New Issue
Block a user