[GB.REPORT]

* BUG: do not use the wrong textextend information for the text
  measure. 


git-svn-id: svn://localhost/gambas/trunk@2691 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Fabien Bodard 2010-02-10 15:01:24 +00:00
parent 03ad4fd2bc
commit 823dd35bc8
4 changed files with 12 additions and 11 deletions

View file

@ -67,9 +67,9 @@ Public Sub _GetSizeHints(AvailableW As Float, AvailableH As Float, TotalWidth As
'if the size choosed by the user is less than the font height, set the object to the font height
hext = Paint.TextExtents($sTmpText)
fTextHeight = MRTools.PixelsToUnits(hext.Height)
fTextWidth = MRTools.PixelsToUnits(hext.Width)
'hext = Paint.TextExtents($sTmpText)
fTextHeight = MRTools.PixelsToUnits(Me.Font.Height($sTmpText)) 'hext.Height)
fTextWidth = MRTools.PixelsToUnits(Me.Font.Width($sTmpText)) 'hext.Width)
If hMyHints.Height < fTextHeight Then hMyHints.Height = fTextHeight + (2 * Me._Padding)
If Me._RelativeHeight Then hMyHints.Height = TotalHeight * Me._Height / 100

View file

@ -55,9 +55,10 @@ Public Sub _GetSizeHints(AvailableW As Float, AvailableH As Float, TotalWidth As
'draw.Font.size = draw.Font.size '* MRTools.ResolutionAffichage
'if the size choosed by the user is less than the font height, set the object to the font height
hext = Paint.TextExtents($sText)
fTextHeight = MRTools.PixelsToUnits(hext.Height + 4)
fTextWidth = MRTools.PixelsToUnits(hext.Width)
'hext = Paint.TextExtents($sText)
fTextHeight = MRTools.PixelsToUnits(Me.Font.Height($sText))
fTextWidth = MRTools.PixelsToUnits(Me.Font.Width($sText))
If hMyHints.Height < fTextHeight Then hMyHints.Height = fTextHeight + (2 * Me._Padding)

View file

@ -55,9 +55,9 @@ Public Sub _GetSizeHints(AvailableW As Float, AvailableH As Float, TotalWidth As
'draw.Font.size = draw.Font.size '* MRTools.ResolutionAffichage
'if the size choosed by the user is less than the font height, set the object to the font height
hext = Paint.TextExtents($sText)
fTextHeight = MRTools.PixelsToUnits(hext.Height)
fTextWidth = MRTools.PixelsToUnits(hext.Width)
'hext = Paint.TextExtents($sText)
fTextHeight = MRTools.PixelsToUnits(Me.Font.Height($sText)) 'hext.Height)
fTextWidth = MRTools.PixelsToUnits(Me.Font.Width($sText)) 'hext.Width)
If hMyHints.Height < fTextHeight Then hMyHints.Height = fTextHeight + (2 * Me._Padding)
If Me._RelativeHeight Then hMyHints.Height = TotalHeight * Me._Height / 100

View file

@ -60,7 +60,7 @@ Public Sub _GetSizeHints(AvailableW As Float, AvailableH As Float, TotalWidth As
hMyHints.Height = Me._Height + (2 * Me._Padding)
If Not IsNull(Me.Font) Then draw.Font = Me.Font
If Not IsNull(Me.Font) Then Paint.Font = Me.Font
draw.Font.size = draw.Font.size
If Me._Width = 0 Then
@ -72,7 +72,7 @@ Public Sub _GetSizeHints(AvailableW As Float, AvailableH As Float, TotalWidth As
If Me._RelativeWidth Then hMyHints.Width = TotalWidth * Me._Width / 100
If hMyHints.Width > AvailableW Then hMyHints.Width = AvailableW
fTextHeight = MRTools.PixelsToUnits(draw.RichTextHeight($sText, MRTools.UnitsToPixels(hMyHints.Width)))
fTextHeight = MRTools.PixelsToUnits(Paint.RichTextHeight($sText, MRTools.UnitsToPixels(hMyHints.Width)))
If hMyHints.Height < fTextHeight Then hMyHints.Height = fTextHeight + (2 * Me._Padding)