Skip to content

Commit

Permalink
Improvement: the Row element respects now available vertical space, w…
Browse files Browse the repository at this point in the history
…hich is closer to expected behavior
  • Loading branch information
MarcinZiabek committed Sep 23, 2023
1 parent 2cf7e52 commit e0dc65d
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 17 deletions.
26 changes: 26 additions & 0 deletions Source/QuestPDF.Examples/RowExamples.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,5 +141,31 @@ void Content(IContainer container)
});
});
}

[Test]
public void RowElementShouldRespectProvidedVerticalSpace()
{
RenderingTest
.Create()
.ProduceImages()
.ShowResults()
.MaxPages(100)
.PageSize(250, 400)
.Render(container =>
{
container
.Padding(25)
.Height(200)
.Border(1)
.Row(row =>
{
row.Spacing(50);
row.RelativeItem().AlignTop().Height(50).Background(Placeholders.BackgroundColor());
row.RelativeItem().AlignMiddle().Height(50).Background(Placeholders.BackgroundColor());
row.RelativeItem().AlignBottom().Height(50).Background(Placeholders.BackgroundColor());
});
});
}
}
}
4 changes: 3 additions & 1 deletion Source/QuestPDF/Elements/Row.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,11 @@ internal override void Draw(Size availableSpace)
var offset = ContentDirection == ContentDirection.LeftToRight
? command.Offset
: new Position(availableSpace.Width - command.Offset.X - command.Size.Width, 0);

var targetSize = new Size(command.Size.Width, availableSpace.Height);

Canvas.Translate(offset);
command.RowItem.Draw(command.Size);
command.RowItem.Draw(targetSize);
Canvas.Translate(offset.Reverse());
}

Expand Down
18 changes: 2 additions & 16 deletions Source/QuestPDF/Resources/ReleaseNotes.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,2 @@
Version 2023.6.0
- Improvement: the library received a final version of the licensing model, which has been enhanced to be more accommodating to both the business and community.
- Feature: generating merged PDF documents.
- Improvement: image loading exception better describes the failure reason.

Version 2023.6.1
- Fix: incorrect layout exception when debugging is disabled
- Fix: the page number functionality for sections do not work (#609)
- Improvement: enhanced the message about the QuestPDF Previewer application version incompatibility

Version 2023.6.2
- Fix: improved `Image.FitUnproportionally` behavior to ensure it now respects minimal size constraints and doesn't just expand to use all the available space.
- Adjustment: increased the default DPI setting from 144 to 288 to better match industry standards and provide visuals of expected quality. To counterbalance for potential output size increase, the image quality has been decreased from "very high" to "high" (JPEG 90 to 75).

Version 2023.6.3
- Fix: the `GeneratePdfAndShow` method does not always properly open the generated PDF file in a default application due to a timing issue.
Version 2023.9.0
- Improvement: the Row element respects now available vertical space, which is closer to expected behavior

0 comments on commit e0dc65d

Please sign in to comment.