TFindDialog: use Position := poMainFormCenter in CalcPosition instead of trying to calculate that by ourselves. Patch by Serge Anvarov.

git-svn-id: trunk@59049 -
This commit is contained in:
bart 2018-09-17 20:15:31 +00:00
parent a62fcc7e69
commit d8993e1b36

View File

@ -575,19 +575,14 @@ begin
end;
procedure TFindDialog.CalcPosition(aForm:Tform);
Var
MfBound : Trect;
begin
//debugln(['TFindDialog.CalcPosition: Left=',Left,', Top=',Top,', Position=',dbgs(position),', FFormLeft=',FFormLeft,', FFormTop=',FFormTop]);
if (FFormLeft < 0) and (FFormTop < 0) then
begin
MfBound := Application.MainForm.BoundsRect;
FFormTop := MfBound.Top + (((MfBound.Bottom - MfBound.Top) - aForm.Height) Div 2);
FFormLeft := MfBound.Left + (((MfBound.Right - MfBound.Left) - aForm.Width) Div 2);
aForm.Position := poMainFormCenter;
FFormTop := aForm.Top;
FFormLeft := aForm.Left;
end;
aForm.Top := FFormTop;
aForm.Left := FFormLeft;
end;