TextHighlighter: Fix Paint() method.

[GB.HIGHLIGHT]
* BUG: TextHighlighter: Fix Paint() method.
This commit is contained in:
Benoît Minisini 2023-10-29 00:47:45 +02:00
parent e815d714d3
commit 1ea56909dc

View file

@ -492,7 +492,7 @@ Public Sub Paint(Text As String, X As Float, Y As Float, Optional Theme As Varia
Dim P As Integer
Dim iColor As Integer
Dim iLine As Integer
Dim XB As Integer
Dim XB As Float
Dim fCharWidth As Float
Dim LH, BW As Integer
Dim LB As Integer
@ -525,8 +525,8 @@ Public Sub Paint(Text As String, X As Float, Y As Float, Optional Theme As Varia
If P < Pos Then
'iLen -= Pos - P
$sToken = String.Mid$($sToken, Pos - P + 1)
P = Pos
$sToken = String.Mid$($sLine, P)
Endif
If fCharWidth Then
@ -535,6 +535,7 @@ Public Sub Paint(Text As String, X As Float, Y As Float, Optional Theme As Varia
X = X0 + Paint.Font.TextWidth(String.Mid($sLine, Pos, P - Pos))
Endif
X = Int(X)
iColor = $hStyle.Color
Paint.Background = iColor
If $hStyle.Bold Then