Просмотр исходного кода

When pasting text to an input box properly clear the currently selected text first

BearishSun 10 лет назад
Родитель
Сommit
e36752c216
1 измененных файлов с 3 добавлено и 1 удалено
  1. 3 1
      BansheeEngine/Source/BsGUIInputBox.cpp

+ 3 - 1
BansheeEngine/Source/BsGUIInputBox.cpp

@@ -1229,8 +1229,10 @@ namespace BansheeEngine
 
 	void GUIInputBox::pasteText()
 	{
-		WString textInClipboard = PlatformUtility::copyFromClipboard();
+		if (mSelectionShown)
+			deleteSelectedText(true);
 
+		WString textInClipboard = PlatformUtility::copyFromClipboard();
 		UINT32 charIdx = gGUIManager().getInputCaretTool()->getCharIdxAtCaretPos();
 
 		bool filterOkay = true;