@@ -65,13 +65,9 @@ Public NotInheritable Class ConsoleCrayon
6565 If foreColor <> Console.ForegroundColor Then Console.ForegroundColor = foreColor
6666 If backColor <> Console.BackgroundColor Then Console.BackgroundColor = backColor
6767
68- 'If row = Console.WindowHeight - 1 AndAlso col + text.Length >= Console.WindowWidth Then
6968 Dim index As Integer = col + row * Console.WindowWidth
7069 Dim size As Integer = Console.WindowWidth * Console.WindowHeight
71- If index + text.Length >= size Then
72- 'text = text.Substring(0, text.Length * 2 + col - Console.WindowWidth - 1)
73- text = text.Substring( 0 , size - index - 1 )
74- End If
70+ If index + text.Length >= size Then text = text.Substring( 0 , size - index - 1 )
7571
7672 Console.Write(text)
7773 End If
@@ -194,11 +190,7 @@ Public NotInheritable Class ConsoleCrayon
194190 Dim a As Double
195191
196192 If dy = 0 Then
197- If dx > 0 Then
198- a = 0
199- Else
200- a = 180
201- End If
193+ a = If (dx > 0 , 0 , 180 )
202194 Else
203195 a = Math.Atan(dy / dx) * toDegrees
204196 Select Case a
@@ -295,8 +287,8 @@ Public NotInheritable Class ConsoleCrayon
295287 End Select
296288 End Function
297289
298- Private Const ESC = Chr( 27 ) + "["
299- Private Const ColorReset = ESC + "0m"
290+ Private Const ESC As String = Chr( 27 ) + "["
291+ Private Const ColorReset As String = ESC + "0m"
300292 Private Shared Function GetAnsiColorControlCode(color As ConsoleColor, isForeground As Boolean ) As String
301293 ' lighter fg colours are 90 -> 97 rather than 30 -> 37
302294 ' lighter bg colours are 100 -> 107 rather than 40 -> 47
0 commit comments