Fixed text rendering (spacing corner case)

This commit is contained in:
Marcin Ziąbek
2021-08-29 19:18:58 +02:00
parent c334390af0
commit 8ada092531
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -181,7 +181,7 @@ namespace QuestPDF.Examples
stack.Item().Text(text =>
{
text.ParagraphSpacing(10);
text.ParagraphSpacing(5);
text.Span(content, normalStyle);
});
+1 -1
View File
@@ -74,7 +74,7 @@ namespace QuestPDF.Elements
return;
var firstHeight = firstSize?.Height ?? 0;
var spaceForSecond = new Size(availableSpace.Width, availableSpace.Height - firstHeight + Size.Epsilon);
var spaceForSecond = new Size(availableSpace.Width, availableSpace.Height - firstHeight);
var secondMeasurement = Second?.Measure(spaceForSecond) as Size;
if (secondMeasurement == null)
+1 -1
View File
@@ -34,7 +34,7 @@ namespace QuestPDF.Elements.Text
var width = lines.Max(x => x.Width);
var height = lines.Sum(x => x.LineHeight);
if (width > availableSpace.Width || height > availableSpace.Height)
if (width > availableSpace.Width + Size.Epsilon || height > availableSpace.Height + Size.Epsilon)
return new Wrap();
var fullyRenderedItemsCount = lines