From d39e93b924b92cfb4f41fb40d359778bd951ae7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Zi=C4=85bek?= Date: Sun, 2 Jan 2022 22:27:48 +0100 Subject: [PATCH] Update Table.cs --- QuestPDF/Elements/Table/Table.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/QuestPDF/Elements/Table/Table.cs b/QuestPDF/Elements/Table/Table.cs index e9b7983..6fca6e5 100644 --- a/QuestPDF/Elements/Table/Table.cs +++ b/QuestPDF/Elements/Table/Table.cs @@ -205,10 +205,12 @@ namespace QuestPDF.Elements.Table return commands.Where(x => x.Cell.Row <= maxRenderingRow).ToList(); } - // if two cells end up on the same row (a.Row + a.RowSpan = b.Row + b.RowSpan), + // corner sase: if two cells end up on the same row (a.Row + a.RowSpan = b.Row + b.RowSpan), // bottom edges of their bounding boxes should be at the same level static void AdjustCellSizes(float tableHeight, ICollection commands) { + // TODO: this is wrong + // should use GroupBy(x => x.Row + x.RowSpan) and determine target height foreach (var command in commands) { var height = tableHeight - command.Offset.Y; @@ -216,7 +218,7 @@ namespace QuestPDF.Elements.Table } } - // all cells, that are last ones in their respective columns, should take all remaining space + // corner sase: all cells, that are last ones in their respective columns, should take all remaining space static void AdjustLastCellSizes(float tableHeight, ICollection commands) { var columnsCount = commands.Select(x => x.Cell).Max(x => x.Column + x.ColumnSpan - 1); @@ -241,4 +243,4 @@ namespace QuestPDF.Elements.Table } } } -} \ No newline at end of file +}