Browse Source

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

Marcin Ziąbek 3 months ago
parent
commit
f059d789a6
1 changed files with 10 additions and 0 deletions
  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()
                 _ => throw new ArgumentOutOfRangeException()
             };
             };
         }
         }
+        
+        internal override void Draw(Size availableSpace)
+        {
+            var measurement = base.Measure(availableSpace);
+            
+            if (measurement.Type is SpacePlanType.Wrap)
+                return;
+                
+            base.Draw(availableSpace);
+        }
     }
     }
 }
 }