Browse Source

2021.11.4 - Fixed measuring the Inlined element

Marcin Ziąbek 4 years ago
parent
commit
63af713935

+ 7 - 6
QuestPDF.Examples/InlinedExamples.cs

@@ -87,23 +87,24 @@ namespace QuestPDF.Examples
         {
             RenderingTest
                 .Create()
-                .PageSize(400, 250)
+                .PageSize(800, 600)
                 .ProduceImages()
                 .ShowResults()
                 .Render(container =>
                 {
                     container
                         .Padding(20)
+                        .Box()
                         .Border(1)
-                        .Background(Colors.Grey.Lighten3)
+                        .Background(Colors.Grey.Lighten4)
                         .Inlined(inlined =>
                         {
                             inlined.VerticalSpacing(50);
-                            inlined.HorizontalSpacing(20);
-                            inlined.AlignSpaceAround();
-                            inlined.BaselineTop();
+                            inlined.HorizontalSpacing(25);
+                            inlined.AlignRight();
+                            inlined.BaselineMiddle();
 
-                            foreach (var _ in Enumerable.Range(0, 20))
+                            foreach (var _ in Enumerable.Range(0, 100))
                                 inlined.Item().Element(RandomBlock);
                         });
                 });

+ 3 - 2
QuestPDF/Elements/Inlined.cs

@@ -64,8 +64,9 @@ namespace QuestPDF.Elements
                 .Select(line =>
                 {
                     var size = GetLineSize(line);
-                    var heightWithSpacing = size.Height + (line.Count - 1) * HorizontalSpacing;
-                    return new Size(size.Width, heightWithSpacing);
+
+                    var widthWithSpacing = size.Width + (line.Count - 1) * HorizontalSpacing;
+                    return new Size(widthWithSpacing, size.Height);
                 })
                 .ToList();
             

+ 1 - 1
QuestPDF/QuestPDF.csproj

@@ -4,7 +4,7 @@
         <Authors>MarcinZiabek</Authors>
         <Company>CodeFlint</Company>
         <PackageId>QuestPDF</PackageId>
-        <Version>2021.11.3</Version>
+        <Version>2021.11.4</Version>
         <PackageDescription>QuestPDF is an open-source, modern and battle-tested library that can help you with generating PDF documents by offering friendly, discoverable and predictable C# fluent API.</PackageDescription>
         <PackageReleaseNotes>$([System.IO.File]::ReadAllText("$(MSBuildProjectDirectory)/Resources/ReleaseNotes.txt"))</PackageReleaseNotes>
         <LangVersion>8</LangVersion>

+ 2 - 0
QuestPDF/Resources/ReleaseNotes.txt

@@ -15,3 +15,5 @@
 - Improved text element: it does not throw an exception when an argument is null.
 
 - All new releases of QuestPDF will contain symbol packages. Let's welcome simplified debugging experience 🎉
+
+- 2021.11.4 - Fixed the Inlined element not rendering properly in some cases.