LCL: TSizeConstraints: not resetting MinWidth when setting MaxWidth to 0

git-svn-id: trunk@14476 -
This commit is contained in:
mattias 2008-03-08 21:16:11 +00:00
parent 83363044f3
commit 19f1b85c1f

View File

@ -165,7 +165,8 @@ procedure TSizeConstraints.SetMaxWidth(Value: TConstraintSize);
begin begin
if Value <> FMaxWidth then begin if Value <> FMaxWidth then begin
FMaxWidth:= Value; FMaxWidth:= Value;
if (FMinWidth > 0) and (FMaxWidth < FMinWidth) then FMinWidth:= FMaxWidth; if (FMinWidth > 0) and (FMaxWidth>0) and (FMaxWidth < FMinWidth) then
FMinWidth:= FMaxWidth;
Change; Change;
end; end;
end; end;
@ -181,7 +182,8 @@ procedure TSizeConstraints.SetMaxHeight(Value: TConstraintSize);
begin begin
if Value <> FMaxHeight then begin if Value <> FMaxHeight then begin
FMaxHeight:= Value; FMaxHeight:= Value;
if (FMinHeight > 0) and (FMaxHeight < FMinHeight) then FMinHeight:= FMaxHeight; if (FMinHeight > 0) and (FMaxHeight>0) and (FMaxHeight < FMinHeight) then
FMinHeight:= FMaxHeight;
Change; Change;
end; end;
end; end;