Sfoglia il codice sorgente

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

Marcin Ziąbek 3 mesi fa
parent
commit
b46d380839
1 ha cambiato i file con 10 aggiunte e 0 eliminazioni
  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);
+        }
     }
 }