Pārlūkot izejas kodu

Improve drawing behaviour of the StopPaging element when its child wraps to the next page

Marcin Ziąbek 3 mēneši atpakaļ
vecāks
revīzija
f059d789a6
1 mainītis faili ar 10 papildinājumiem un 0 dzēšanām
  1. 10 0
      Source/QuestPDF/Elements/StopPaging.cs

+ 10 - 0
Source/QuestPDF/Elements/StopPaging.cs

@@ -19,5 +19,15 @@ namespace QuestPDF.Elements
                 _ => throw new ArgumentOutOfRangeException()
             };
         }
+        
+        internal override void Draw(Size availableSpace)
+        {
+            var measurement = base.Measure(availableSpace);
+            
+            if (measurement.Type is SpacePlanType.Wrap)
+                return;
+                
+            base.Draw(availableSpace);
+        }
     }
 }