Fixes alt-tab crash when the chatbox is open. (#33)

* Fix alt-tab crash when the user open the chatbox and did an alt-tab.

* remove accidental imports
This commit is contained in:
Yong Jian Ming 2020-07-23 05:39:01 +08:00 committed by GitHub
parent ae774a615b
commit f0fe3a53b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -88,6 +88,10 @@ Public Class ChatScreen
'Crops too long input text:
If FontManager.TextFont.MeasureString(Me.currentText).X * 2.0F > Core.windowSize.Width - 200 Then
While FontManager.TextFont.MeasureString(Me.currentText).X * 2.0F > Core.windowSize.Width - 200
If Me.currentText.Length = 0 Then
Exit While
End If
Me.currentText = Me.currentText.Remove(Me.currentText.Length - 1, 1)
End While
End If