Преглед изворни кода

Fix width for box when available size is indefinite to also be indefinite

Michael Ragazzon пре 5 месеци
родитељ
комит
612e7d2b61
1 измењених фајлова са 4 додато и 1 уклоњено
  1. 4 1
      Source/Core/Layout/LayoutDetails.cpp

+ 4 - 1
Source/Core/Layout/LayoutDetails.cpp

@@ -459,10 +459,13 @@ void LayoutDetails::BuildBoxWidth(Box& box, const ComputedValues& computed, floa
 
 		if (!shrink_to_fit)
 		{
-			// The width is set to whatever remains of the containing block.
+			// The width is set to fill the remaining space of the containing block, if the available space is definite.
+			if (containing_block.x >= 0.f)
+			{
 			const float accumulated_edges = GetInsetWidth() + box.GetSizeAcross(BoxDirection::Horizontal, BoxArea::Margin, BoxArea::Padding);
 			content_area.x = Math::Max(containing_block.x - accumulated_edges, 0.f);
 		}
+		}
 		else
 		{
 			// Leave width negative to indicate it should have its shrink-to-fit width evaluated.