|
@@ -281,6 +281,7 @@ var
|
|
begin
|
|
begin
|
|
El:=Node.Element;
|
|
El:=Node.Element;
|
|
|
|
|
|
|
|
+ //writeln('TFLNodeLayouter.Apply ',El.ClassName,' ',FloatToCSSStr(Node.Width),'x',FloatToCSSStr(Node.Height));
|
|
MaxWidth:=Node.Width;
|
|
MaxWidth:=Node.Width;
|
|
if IsNan(MaxWidth) then
|
|
if IsNan(MaxWidth) then
|
|
MaxWidth:=Node.MaxWidth;
|
|
MaxWidth:=Node.MaxWidth;
|
|
@@ -340,6 +341,7 @@ begin
|
|
Node.Height:=AvailHeight;
|
|
Node.Height:=AvailHeight;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+ //writeln('TFLNodeLayouter.Apply "',Node.Element.Name,'" AvailWidth=',FloatToCSSStr(AvailWidth));
|
|
ApplyOverflow(AvailWidth,AvailHeight);
|
|
ApplyOverflow(AvailWidth,AvailHeight);
|
|
{$IFDEF VerboseFresnelScrolling}
|
|
{$IFDEF VerboseFresnelScrolling}
|
|
writeln('TFLNodeLayouter.Apply "',Node.Element.Name,'" ScrollSize: ',FloatToCSSStr(Node.ScrollWidth),'x',FloatToCSSStr(Node.ScrollHeight),' Width=',FloatToCSSStr(Node.Width),' Height=',FloatToCSSStr(Node.Height));
|
|
writeln('TFLNodeLayouter.Apply "',Node.Element.Name,'" ScrollSize: ',FloatToCSSStr(Node.ScrollWidth),'x',FloatToCSSStr(Node.ScrollHeight),' Width=',FloatToCSSStr(Node.Width),' Height=',FloatToCSSStr(Node.Height));
|
|
@@ -1251,10 +1253,12 @@ begin
|
|
aMaxHeight:=ChildNode.MaxHeight;
|
|
aMaxHeight:=ChildNode.MaxHeight;
|
|
end;
|
|
end;
|
|
Size:=ChildEl.GetIntrinsicContentSize(aMode,aMaxWidth,aMaxHeight);
|
|
Size:=ChildEl.GetIntrinsicContentSize(aMode,aMaxWidth,aMaxHeight);
|
|
|
|
+ //writeln('TFLLineLayouter.PlaceAbsoluteItem ',ChildEl.GetPath,' Size=',Size.ToString);
|
|
if IsNan(NewWidth) then
|
|
if IsNan(NewWidth) then
|
|
NewWidth:=ChildNode.FitWidth(Size.Width);
|
|
NewWidth:=ChildNode.FitWidth(Size.Width);
|
|
if IsNan(NewHeight) then
|
|
if IsNan(NewHeight) then
|
|
NewHeight:=ChildNode.FitHeight(Size.Height);
|
|
NewHeight:=ChildNode.FitHeight(Size.Height);
|
|
|
|
+ //writeln('TFLLineLayouter.PlaceAbsoluteItem ',ChildEl.GetPath,' NewWidth=',FloatToCSSStr(NewWidth));
|
|
|
|
|
|
if IsNan(NewLeft) then
|
|
if IsNan(NewLeft) then
|
|
begin
|
|
begin
|
|
@@ -1277,20 +1281,24 @@ begin
|
|
else
|
|
else
|
|
NewTop:=aMaxHeight-NewBottom-NewHeight-FrameTop-FrameBottom;
|
|
NewTop:=aMaxHeight-NewBottom-NewHeight-FrameTop-FrameBottom;
|
|
end;
|
|
end;
|
|
|
|
+ if IsNan(NewBottom) then
|
|
|
|
+ begin
|
|
|
|
+ if IsNan(aMaxHeight) then
|
|
|
|
+ NewBottom:=0
|
|
|
|
+ else
|
|
|
|
+ NewBottom:=aMaxHeight-NewHeight-FrameTop-FrameBottom-NewTop;
|
|
|
|
+ end;
|
|
|
|
|
|
// compute right, bottom of marginbox
|
|
// compute right, bottom of marginbox
|
|
Result.Width:=NewLeft+FrameLeft+NewWidth+FrameRight;
|
|
Result.Width:=NewLeft+FrameLeft+NewWidth+FrameRight;
|
|
//writeln('TFLLineLayouter.PlaceAbsoluteItem ',ChildEl.Name,' NewLeft=',FloatToCSSStr(NewLeft),' FrameLeft=',FloatToCSSStr(FrameLeft),' NewWidth=',FloatToCSSStr(NewWidth),' FrameRight=',FloatToCSSStr(FrameRight),' NewRight=',FloatToCSSStr(NewRight));
|
|
//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.Height:=NewTop+FrameTop+NewHeight+FrameBottom;
|
|
Result.Height:=NewTop+FrameTop+NewHeight+FrameBottom;
|
|
//writeln('TFLLineLayouter.PlaceAbsoluteItem ',ChildEl.Name,' NewTop=',FloatToCSSStr(NewTop),' FrameTop=',FloatToCSSStr(FrameTop),' NewHeight=',FloatToCSSStr(NewHeight),' FrameBottom=',FloatToCSSStr(FrameBottom),' NewBottom=',FloatToCSSStr(NewBottom));
|
|
//writeln('TFLLineLayouter.PlaceAbsoluteItem ',ChildEl.Name,' NewTop=',FloatToCSSStr(NewTop),' FrameTop=',FloatToCSSStr(FrameTop),' NewHeight=',FloatToCSSStr(NewHeight),' FrameBottom=',FloatToCSSStr(FrameBottom),' NewBottom=',FloatToCSSStr(NewBottom));
|
|
- if (not IsNan(NewBottom)) and (NewBottom>0) then
|
|
|
|
- Result.Height:=Result.Height+NewBottom;
|
|
|
|
|
|
|
|
// overflow (render hull)
|
|
// overflow (render hull)
|
|
Result.Overflow:=Size.Overflow;
|
|
Result.Overflow:=Size.Overflow;
|
|
|
|
+ //writeln('TFLLineLayouter.PlaceAbsoluteItem ',ChildEl.GetPath,' Result=',Result.ToString);
|
|
Result.Overflow.Offset(NewLeft+FrameLeft,NewTop+FrameTop);
|
|
Result.Overflow.Offset(NewLeft+FrameLeft,NewTop+FrameTop);
|
|
if Result.Overflow.Right<Result.Width then
|
|
if Result.Overflow.Right<Result.Width then
|
|
Result.Overflow.Right:=Result.Width;
|
|
Result.Overflow.Right:=Result.Width;
|
|
@@ -1512,7 +1520,7 @@ begin
|
|
Result:=default(TFreIntrinsicContentSize);
|
|
Result:=default(TFreIntrinsicContentSize);
|
|
FOverflow:=default(TFresnelRect);
|
|
FOverflow:=default(TFresnelRect);
|
|
|
|
|
|
- //writeln('AAA5 TFLFlowLayouter.ComputeLayoutContent ',Node.Element.GetPath,' ',aMode,' MaxWidth=',FloatToCSSStr(aMaxWidth),' MaxHeight=',FloatToCSSStr(aMaxHeight),' Commit=',Commit);
|
|
|
|
|
|
+ //writeln('TFLFlowLayouter.ComputeLayoutContent ',Node.Element.GetPath,' ',aMode,' MaxWidth=',FloatToCSSStr(aMaxWidth),' MaxHeight=',FloatToCSSStr(aMaxHeight),' Commit=',Commit);
|
|
|
|
|
|
// ToDo: line-height
|
|
// ToDo: line-height
|
|
// ToDo: baseline
|
|
// ToDo: baseline
|