diff --git a/comp/src/gb.gui.base/.src/Label.class b/comp/src/gb.gui.base/.src/Label.class index f9da8e9f8..9c9a5bc96 100644 --- a/comp/src/gb.gui.base/.src/Label.class +++ b/comp/src/gb.gui.base/.src/Label.class @@ -91,12 +91,13 @@ Public Sub _UpdateSize() Dim W As Integer Dim H As Integer Dim P As Integer + Dim hRect As Rect $hExt = Null + If $bLocked Then Return If Me.Design Then Return If Not $bAutoResize Then Return If Not $sText Then Return - If $bLocked Then Return $bLocked = True @@ -104,17 +105,17 @@ Public Sub _UpdateSize() If $bRichText Then If _Wrap Then - W = Me.W - H = P * 2 + Me.Font.RichTextHeight($sText, W - P * 2) + hRect = Me.Font.RichTextSize($sText, Me.W - P * 2) Else - W = P * 2 + Me.Font.RichTextWidth($sText) - H = P * 2 + Me.Font.RichTextHeight($sText) + hRect = Me.Font.RichTextSize($sText) Endif Else - W = P * 2 + Me.Font.TextWidth($sText) - H = P * 2 + Me.Font.TextHeight($sText) + hRect = Me.Font.TextSize($sText) Endif + W = hRect.W + P * 2 + H = hRect.H + P * 2 + If Align.IsMiddle($iAlign) Then If H < Me.H Then H = Me.H Endif