From 4ba349fd6e5430bdfe3ab722c26de9fea1bea4ba Mon Sep 17 00:00:00 2001 From: ondrej Date: Mon, 6 Mar 2017 15:34:11 +0000 Subject: [PATCH] LCL: form: fix AutoAdjustLayout if constraints are used. Issue #31336 git-svn-id: trunk@54353 - --- lcl/include/customform.inc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lcl/include/customform.inc b/lcl/include/customform.inc index 70c8856e3d..bfd063c2a5 100644 --- a/lcl/include/customform.inc +++ b/lcl/include/customform.inc @@ -1570,7 +1570,7 @@ end; procedure TCustomForm.DoAutoAdjustLayout(const AMode: TLayoutAdjustmentPolicy; const AXProportion, AYProportion: Double); var - NewWidth, NewHeight, OldWidth, OldHeight: Integer; + NewWidth, NewHeight: Integer; begin if Assigned(Parent) then begin @@ -1584,10 +1584,13 @@ begin if not ParentFont or (Parent=nil) then ScaleFontsPPI(AYProportion); + NewWidth := Round(Width*AXProportion); + NewHeight := Round(Height*AYProportion); + BorderSpacing.AutoAdjustLayout(AXProportion, AYProportion); Constraints.AutoAdjustLayout(AXProportion, AYProportion); - SetBounds(Left, Top, Round(Width*AXProportion), Round(Height*AYProportion)); + SetBounds(Left, Top, NewWidth, NewHeight); end; end;