| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- using NUnit.Framework;
- using QuestPDF.Examples.Engine;
- using QuestPDF.Fluent;
- using QuestPDF.Helpers;
- using QuestPDF.Infrastructure;
- namespace QuestPDF.Examples
- {
- public class RowExamples
- {
- [Test]
- public void Stability()
- {
- // up to version 2021.12, this code would always result with the infinite layout exception
-
- RenderingTest
- .Create()
- .ProducePdf()
- .MaxPages(100)
- .PageSize(250, 150)
- .ShowResults()
- .Render(container =>
- {
- container
- .Padding(25)
- .Row(row =>
- {
- row.RelativeColumn().Stack(stack =>
- {
- stack.Item().ShowOnce().Element(CreateBox).Text("X");
- stack.Item().Element(CreateBox).Text("1");
- stack.Item().Element(CreateBox).Text("2");
- });
-
- row.RelativeColumn().Stack(stack =>
- {
- stack.Item().Element(CreateBox).Text("1");
- stack.Item().Element(CreateBox).Text("2");
- });
- });
- });
- static IContainer CreateBox(IContainer container)
- {
- return container
- .ExtendHorizontal()
- .ExtendVertical()
- .Background(Colors.Grey.Lighten4)
- .Border(1)
- .AlignCenter()
- .AlignMiddle()
- .ShowOnce();
- }
- }
- }
- }
|