mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-15 18:39:09 +02:00
fixed calculating EffectiveMaxWidth and EffectiveMaxHeight
git-svn-id: trunk@6641 -
This commit is contained in:
parent
dd8c50dc28
commit
c2ffe68e8d
@ -87,22 +87,32 @@ begin
|
|||||||
Result:=MinInterfaceHeight;
|
Result:=MinInterfaceHeight;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
// EffectiveMaxWidth is the minumum of MaxWidth and MaxInterfaceWidth,
|
||||||
|
// but is at least MinInterfaceWidth.
|
||||||
|
// A value of zero is interpreted as unconstraint.
|
||||||
function TSizeConstraints.EffectiveMaxWidth: integer;
|
function TSizeConstraints.EffectiveMaxWidth: integer;
|
||||||
begin
|
begin
|
||||||
if (MaxWidth<MaxInterfaceWidth) then begin
|
if (MaxInterfaceWidth>0) and
|
||||||
|
((MaxWidth=0) or (MaxInterfaceWidth<MaxWidth)) then
|
||||||
|
Result := MaxInterfaceWidth
|
||||||
|
else
|
||||||
Result:=MaxWidth;
|
Result:=MaxWidth;
|
||||||
if (Result<MinInterfaceWidth) then Result:=MinInterfaceWidth;
|
if (Result>0) and (MinInterfaceWidth>0) and (Result<MinInterfaceWidth) then
|
||||||
end else
|
Result:=MinInterfaceWidth;
|
||||||
Result:=MaxInterfaceWidth;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
// EffectiveMaxHeight is the minumum of MaxHeight and MaxInterfaceHeight,
|
||||||
|
// but is at least MinInterfaceHeight.
|
||||||
|
// A value of zero is interpreted as unconstraint.
|
||||||
function TSizeConstraints.EffectiveMaxHeight: integer;
|
function TSizeConstraints.EffectiveMaxHeight: integer;
|
||||||
begin
|
begin
|
||||||
if (MaxHeight<MaxInterfaceHeight) then begin
|
if (MaxInterfaceHeight>0) and
|
||||||
|
((MaxHeight=0) or (MaxInterfaceHeight<MaxHeight)) then
|
||||||
|
Result := MaxInterfaceHeight
|
||||||
|
else
|
||||||
Result:=MaxHeight;
|
Result:=MaxHeight;
|
||||||
if Result<MinInterfaceHeight then Result:=MinInterfaceHeight;
|
if (Result>0) and (MinInterfaceHeight>0) and (Result<MinInterfaceHeight) then
|
||||||
end else
|
Result:=MinInterfaceHeight;
|
||||||
Result:=MaxInterfaceHeight;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TSizeConstraints.MinMaxWidth(Width: integer): integer;
|
function TSizeConstraints.MinMaxWidth(Width: integer): integer;
|
||||||
|
Loading…
Reference in New Issue
Block a user