On Thu, 18 May 2017, Luca Olivetti via Lazarus wrote:
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?
An "In" was limited to a range of 0..255.
As far as I know, this is still so, but a compiler guru will need to confirm.
If (NeededWidth in [1..MaxWidth]) was used for speed reasons, I'm not sure
that that is a good idea.
Michael.
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
--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus
--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus