[Lazarus] Lazarus Release Candidate 1 of 1.8.0
Luca Olivetti
luca at wetron.es
Thu May 18 09:38:41 CEST 2017
El 18/05/17 a les 09:17, Luca Olivetti via Lazarus ha escrit:
> El 17/05/17 a les 20:22, Luca Olivetti via Lazarus ha escrit:
>> El 17/05/17 a les 20:16, Luca Olivetti via Lazarus ha escrit:
>>> Excellent, this is OK, with my selected fonts and correctly sized icons.
>>> It still has the problem with optimalfill, so it's definitely not
>>> platform specific.
>>
>>
>> See https://youtu.be/NFZGVx7V2C0
>>
> FWIW if I revert the implementation of CalcFittingFontHeight
> (lcl/include/customlabel.inc) to the one in lazarus 1.6.4 this doesn't
> happen anymore.
> I'll try to see what changed and what broke it.
This seems to fix it, maybe fpc 2.6.4 doesn't manage well a "in" with a
range of integers?
Index: lcl/include/customlabel.inc
===================================================================
--- lcl/include/customlabel.inc (revision 54949)
+++ lcl/include/customlabel.inc (working copy)
@@ -355,7 +355,7 @@
NeededWidth := R.Right - R.Left;
NeededHeight := R.Bottom - R.Top;
//debugln('TCustomLabel.CalcFittingFontHeight B
NeededWidth=',dbgs(NeededWidth),' NeededHeight=',dbgs(NeededHeight),'
MaxWidth=',dbgs(MaxWidth),' MaxHeight=',dbgs(MaxHeight));
- if (NeededWidth in [1..MaxWidth]) and (NeededHeight in
[1..MaxHeight]) then
+ if (NeededWidth > 0) and (NeededWidth <= MaxWidth) and
(NeededHeight > 0) and (NeededHeight <= MaxHeight) then
begin
// TheText fits into the bounds
if (not Result) or (FontHeight < TestFont.Height) then
--
Luca Olivetti
Wetron Automation Technology http://www.wetron.es/
Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007
More information about the Lazarus
mailing list