Browse Source

Fixed: The AspectRatio element may incorrectly arrange its content in rare

Marcin Ziąbek 9 months ago
parent
commit
6fc1d62469
1 changed files with 3 additions and 0 deletions
  1. 3 0
      Source/QuestPDF/Elements/AspectRatio.cs

+ 3 - 0
Source/QuestPDF/Elements/AspectRatio.cs

@@ -20,6 +20,9 @@ namespace QuestPDF.Elements
             if (Child.IsEmpty())
                 return SpacePlan.Empty();
             
+            if (availableSpace.Width == 0 && availableSpace.Height == 0)
+                return SpacePlan.Wrap("The available space is zero.");
+            
             var targetSize = GetTargetSize(availableSpace);
             
             if (targetSize.Height > availableSpace.Height + Size.Epsilon)