|
@@ -325,8 +325,8 @@ begin
|
|
|
if Node.Height>AvailHeight then
|
|
|
Node.Height:=AvailHeight;
|
|
|
end;
|
|
|
- Node.ScrollWidth:=Max(Size.ScrollWidth,AvailWidth);
|
|
|
- Node.ScrollHeight:=Max(Size.ScrollHeight,AvailHeight);
|
|
|
+ Node.ScrollWidth:=Max(Size.OverflowWidth,AvailWidth);
|
|
|
+ Node.ScrollHeight:=Max(Size.OverflowHeight,AvailHeight);
|
|
|
{$IFDEF VerboseFresnelScrolling}
|
|
|
writeln('TFLNodeLayouter.Apply "',Node.Element.Name,'" ScrollSize: ',FloatToCSSStr(Node.ScrollWidth),'x',FloatToCSSStr(Node.ScrollHeight),' Width=',FloatToCSSStr(Node.Width),' Height=',FloatToCSSStr(Node.Height));
|
|
|
{$ENDIF}
|
|
@@ -351,8 +351,8 @@ begin
|
|
|
Node.Width:=Node.FitWidth(Size.Width);
|
|
|
if IsNan(Node.Height) then
|
|
|
Node.Height:=Node.FitHeight(Size.Height);
|
|
|
- Node.ScrollWidth:=Max(Size.ScrollWidth,Node.Width);
|
|
|
- Node.ScrollHeight:=Max(Size.ScrollHeight,Node.Height);
|
|
|
+ Node.ScrollWidth:=Max(Size.OverflowWidth,Node.Width);
|
|
|
+ Node.ScrollHeight:=Max(Size.OverflowHeight,Node.Height);
|
|
|
end;
|
|
|
|
|
|
// clipping
|
|
@@ -870,8 +870,8 @@ end;
|
|
|
|
|
|
procedure TUsedLayoutNode.ApplyScrollSize(const aSize: TFreIntrinsicContentSize);
|
|
|
begin
|
|
|
- ScrollWidth:=aSize.ScrollWidth;
|
|
|
- ScrollHeight:=aSize.ScrollHeight;
|
|
|
+ ScrollWidth:=aSize.OverflowWidth;
|
|
|
+ ScrollHeight:=aSize.OverflowHeight;
|
|
|
if (GutterHorizontal=gmAuto) and aSize.NeedGutterHorizontal then
|
|
|
AddScrollGutter(true);
|
|
|
if (GutterVertical=gmAuto) and aSize.NeedGutterVertical then
|
|
@@ -910,7 +910,7 @@ begin
|
|
|
if (not IsNan(Left)) and (not IsNan(Right)) then
|
|
|
begin
|
|
|
// left & right -> width
|
|
|
- aContainerWidth:=Element.GetContainerContentWidth(true);
|
|
|
+ aContainerWidth:=Element.GetContainerPaddingWidth(true);
|
|
|
if not IsNan(aContainerWidth) then
|
|
|
begin
|
|
|
Width:=aContainerWidth-Left-MarginLeft-BorderLeft-PaddingLeft
|
|
@@ -925,14 +925,14 @@ begin
|
|
|
if not IsNan(Right) then
|
|
|
begin
|
|
|
// width & right -> left
|
|
|
- aContainerWidth:=Element.GetContainerContentWidth(true);
|
|
|
+ aContainerWidth:=Element.GetContainerPaddingWidth(true);
|
|
|
if not IsNan(aContainerWidth) then
|
|
|
Left:=aContainerWidth-Width-MarginLeft-BorderLeft-PaddingLeft
|
|
|
-Right-MarginRight-BorderRight-PaddingRight;
|
|
|
end;
|
|
|
end else if IsNan(Right) then begin
|
|
|
// width & left -> right
|
|
|
- aContainerWidth:=Element.GetContainerContentWidth(true);
|
|
|
+ aContainerWidth:=Element.GetContainerPaddingWidth(true);
|
|
|
if not IsNan(aContainerWidth) then
|
|
|
Right:=aContainerWidth-Width-Left-MarginLeft-BorderLeft-PaddingLeft
|
|
|
-MarginRight-BorderRight-PaddingRight;
|
|
@@ -944,7 +944,7 @@ begin
|
|
|
if (not IsNan(Top)) and (not IsNan(Bottom)) then
|
|
|
begin
|
|
|
// Top & Bottom -> Height
|
|
|
- aContainerHeight:=Element.GetContainerContentHeight(true);
|
|
|
+ aContainerHeight:=Element.GetContainerPaddingHeight(true);
|
|
|
if not IsNan(aContainerHeight) then
|
|
|
begin
|
|
|
Height:=aContainerHeight-Top-MarginTop-BorderTop-PaddingTop
|
|
@@ -959,14 +959,14 @@ begin
|
|
|
if not IsNan(Bottom) then
|
|
|
begin
|
|
|
// Height & Bottom -> Top
|
|
|
- aContainerHeight:=Element.GetContainerContentHeight(true);
|
|
|
+ aContainerHeight:=Element.GetContainerPaddingHeight(true);
|
|
|
if not IsNan(aContainerHeight) then
|
|
|
Top:=aContainerHeight-Height-MarginTop-BorderTop-PaddingTop
|
|
|
-Bottom-MarginBottom-BorderBottom-PaddingBottom;
|
|
|
end;
|
|
|
end else if IsNan(Bottom) then begin
|
|
|
// Height & Top -> Bottom
|
|
|
- aContainerHeight:=Element.GetContainerContentHeight(true);
|
|
|
+ aContainerHeight:=Element.GetContainerPaddingHeight(true);
|
|
|
if not IsNan(aContainerHeight) then
|
|
|
Bottom:=aContainerHeight-Height-Top-MarginTop-BorderTop-PaddingTop
|
|
|
-MarginBottom-BorderBottom-PaddingBottom;
|
|
@@ -1142,18 +1142,18 @@ var
|
|
|
N.StaticLeft:=ChildMBoxLeft;
|
|
|
N.ContentBoxWidth:=ChildWidth;
|
|
|
N.ContentBoxHeight:=ChildHeight;
|
|
|
- N.IntrinsicWidth:=Max(ChildWidth,ChildPrefSize.ScrollWidth);
|
|
|
- N.IntrinsicHeight:=Max(ChildHeight,ChildPrefSize.ScrollHeight);
|
|
|
+ N.IntrinsicWidth:=Max(ChildWidth,ChildPrefSize.OverflowWidth);
|
|
|
+ N.IntrinsicHeight:=Max(ChildHeight,ChildPrefSize.OverflowHeight);
|
|
|
Result.Width:=Max(Result.Width,ChildMBoxRight);
|
|
|
|
|
|
- if Result.ScrollWidth<Result.Width then
|
|
|
- Result.ScrollWidth:=Result.Width;
|
|
|
- r:=ChildPrefSize.ScrollWidth-ChildWidth;
|
|
|
+ if Result.OverflowWidth<Result.Width then
|
|
|
+ Result.OverflowWidth:=Result.Width;
|
|
|
+ r:=ChildPrefSize.OverflowWidth-ChildWidth;
|
|
|
if r>0 then
|
|
|
begin
|
|
|
r:=ChildMBoxRight+r;
|
|
|
- if Result.ScrollWidth<r then
|
|
|
- Result.ScrollWidth:=r;
|
|
|
+ if Result.OverflowWidth<r then
|
|
|
+ Result.OverflowWidth:=r;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
@@ -1390,10 +1390,14 @@ begin
|
|
|
ChildDefPos.Y:=AbsItem.StaticTop;
|
|
|
|
|
|
ChildPrefSize:=PlaceAbsoluteItem(ChildNode,aMode,aMaxWidth,aMaxHeight,ChildDefPos,Commit);
|
|
|
- if Result.ScrollWidth<ChildPrefSize.ScrollWidth then
|
|
|
- Result.ScrollWidth:=ChildPrefSize.ScrollWidth;
|
|
|
- if Result.ScrollHeight<ChildPrefSize.ScrollHeight then
|
|
|
- Result.ScrollHeight:=ChildPrefSize.ScrollHeight;
|
|
|
+ // an absolute item is excluded from the auto-content size,
|
|
|
+ // and included in the overflow size
|
|
|
+ //writeln('TFLFlowLayouter.ComputeLayoutContent ',ChildEl.Name,' ChildPrefSize=',ChildPrefSize.ToString,' Result=',Result.ToString);
|
|
|
+ if Result.OverflowWidth<ChildPrefSize.OverflowWidth then
|
|
|
+ Result.OverflowWidth:=ChildPrefSize.OverflowWidth;
|
|
|
+ if Result.OverflowHeight<ChildPrefSize.OverflowHeight then
|
|
|
+ Result.OverflowHeight:=ChildPrefSize.OverflowHeight;
|
|
|
+ //writeln('TFLFlowLayouter.ComputeLayoutContent ',ChildEl.Name,' ChildPrefSize=',ChildPrefSize.ToString,' Result=',Result.ToString);
|
|
|
end;
|
|
|
end;
|
|
|
if FAbsoluteItems<>nil then
|
|
@@ -2129,39 +2133,45 @@ begin
|
|
|
|
|
|
// compute right, bottom of marginbox
|
|
|
Result.Width:=NewLeft+FrameLeft+NewWidth+FrameRight;
|
|
|
- if not IsNan(NewRight) then
|
|
|
+ //writeln('TFLLineLayouter.PlaceAbsoluteItem ',ChildEl.Name,' NewLeft=',FloatToCSSStr(NewLeft),' FrameLeft=',FloatToCSSStr(FrameLeft),' NewWidth=',FloatToCSSStr(NewWidth),' FrameRight=',FloatToCSSStr(FrameRight),' NewRight=',FloatToCSSStr(NewRight));
|
|
|
+ if (not IsNan(NewRight)) and (NewRight>0) then
|
|
|
Result.Width:=Result.Width+NewRight;
|
|
|
- Result.ScrollWidth:=Result.Width;
|
|
|
- if Size.ScrollWidth>NewWidth then
|
|
|
+ Result.OverflowWidth:=Result.Width;
|
|
|
+ if Size.OverflowWidth>NewWidth then
|
|
|
begin
|
|
|
- Result.ScrollWidth:=FrameLeft+Result.ScrollWidth;
|
|
|
+ Result.OverflowWidth:=FrameLeft+Result.OverflowWidth;
|
|
|
if not IsNan(NewLeft) then
|
|
|
- Result.ScrollWidth:=Result.ScrollWidth+NewLeft;
|
|
|
- if Result.ScrollWidth<Result.Width then
|
|
|
- Result.ScrollWidth:=Result.Width;
|
|
|
+ Result.OverflowWidth:=Result.OverflowWidth+NewLeft;
|
|
|
+ if Result.OverflowWidth<Result.Width then
|
|
|
+ Result.OverflowWidth:=Result.Width;
|
|
|
end;
|
|
|
|
|
|
- Result.Height:=FrameTop+NewWidth+FrameBottom;
|
|
|
+ Result.Height:=FrameTop+NewHeight+FrameBottom;
|
|
|
+ //writeln('TFLLineLayouter.PlaceAbsoluteItem ',ChildEl.Name,' NewTop=',FloatToCSSStr(NewTop),' FrameTop=',FloatToCSSStr(FrameTop),' NewHeight=',FloatToCSSStr(NewHeight),' FrameBottom=',FloatToCSSStr(FrameBottom),' NewBottom=',FloatToCSSStr(NewBottom));
|
|
|
if not IsNan(NewTop) then
|
|
|
Result.Height:=Result.Height+NewTop;
|
|
|
- if not IsNan(NewBottom) then
|
|
|
+ if (not IsNan(NewBottom)) and (NewBottom>0) then
|
|
|
Result.Height:=Result.Height+NewBottom;
|
|
|
- Result.ScrollHeight:=Result.Height;
|
|
|
- if Size.ScrollHeight>NewHeight then
|
|
|
+ Result.OverflowHeight:=Result.Height;
|
|
|
+ if Size.OverflowHeight>NewHeight then
|
|
|
begin
|
|
|
- Result.ScrollHeight:=FrameTop+Result.ScrollHeight;
|
|
|
+ Result.OverflowHeight:=FrameTop+Result.OverflowHeight;
|
|
|
if not IsNan(NewTop) then
|
|
|
- Result.ScrollHeight:=Result.ScrollHeight+NewTop;
|
|
|
- if Result.ScrollHeight<Result.Height then
|
|
|
- Result.ScrollHeight:=Result.Height;
|
|
|
+ Result.OverflowHeight:=Result.OverflowHeight+NewTop;
|
|
|
+ if Result.OverflowHeight<Result.Height then
|
|
|
+ Result.OverflowHeight:=Result.Height;
|
|
|
end;
|
|
|
|
|
|
+ writeln('TFLLineLayouter.PlaceAbsoluteItem ',ChildEl.GetPath,' Result=',Result.ToString);
|
|
|
+
|
|
|
if Commit then
|
|
|
begin
|
|
|
+ // marginbox
|
|
|
ChildNode.Left:=NewLeft;
|
|
|
ChildNode.Top:=NewTop;
|
|
|
ChildNode.Right:=NewRight;
|
|
|
ChildNode.Bottom:=NewBottom;
|
|
|
+ // contentbox
|
|
|
ChildNode.Width:=NewWidth;
|
|
|
ChildNode.Height:=NewHeight;
|
|
|
|