LCL: fix autosizing for not-aligned controls. Issue #28654

git-svn-id: trunk@56947 -
This commit is contained in:
ondrej 2018-01-04 06:24:36 +00:00
parent 8726ea2759
commit 9ecac75432
2 changed files with 17 additions and 16 deletions

View File

@ -3025,16 +3025,13 @@ procedure TControl.DoAllAutoSize;
var
AWinControl: TWinControl;
i: Integer;
Needed: Boolean;
begin
if AControl.AutoSizeDelayed then exit;
Needed:=cfAutoSizeNeeded in AControl.FControlFlags;
//DebugLn(['TControl.DoAllAutoSize.AutoSizeControl ',DbgSName(AControl),' AutoSize=',AControl.AutoSize,' IsControlVisible=',AControl.IsControlVisible,' cfAutoSizeNeeded=',Needed]);
Exclude(AControl.FControlFlags, cfAutoSizeNeeded);
if not AControl.IsControlVisible then exit;
if Needed and AControl.AutoSize and
if AControl.IsControlVisible then
begin
if (cfAutoSizeNeeded in AControl.FControlFlags) and AControl.AutoSize and
(not ((AControl.Parent = nil) and (csDesigning in AControl.ComponentState)))
then
AControl.DoAutoSize;
@ -3048,6 +3045,8 @@ procedure TControl.DoAllAutoSize;
AutoSizeControl(AWinControl.Controls[i]);
end;
end;
Exclude(AControl.FControlFlags, cfAutoSizeNeeded);
end;
function CallAllOnResize(AControl: TControl): boolean;
// The OnResize event is called for Delphi compatibility after child resizes.

View File

@ -2554,6 +2554,8 @@ var
CurControl: TControl;
begin
Result := True;
if cfAutoSizeNeeded in FControlFlags then
Exit;
for I := ControlCount - 1 downto 0 do
begin
CurControl:=Controls[I];