Browse Source

reduce scope of variable (remove unneeded calc)

Antony Corbett 2 years ago
parent
commit
24beea80c7
1 changed files with 5 additions and 4 deletions
  1. 5 4
      Source/QuestPDF/Elements/Table/Table.cs

+ 5 - 4
Source/QuestPDF/Elements/Table/Table.cs

@@ -168,12 +168,13 @@ namespace QuestPDF.Elements.Table
 
 
             if (!commands.Any())
             if (!commands.Any())
                 return commands;
                 return commands;
-            
-            var tableHeight = commands.Max(cell => cell.Offset.Y + cell.Size.Height);
-            
+
             if (ExtendLastCellsToTableBottom)
             if (ExtendLastCellsToTableBottom)
+            {
+                var tableHeight = commands.Max(cell => cell.Offset.Y + cell.Size.Height);
                 AdjustLastCellSizes(tableHeight, commands);
                 AdjustLastCellSizes(tableHeight, commands);
-            
+            }
+
             return commands;
             return commands;
 
 
             static float[] GetColumnLeftOffsets(IList<TableColumnDefinition> columns)
             static float[] GetColumnLeftOffsets(IList<TableColumnDefinition> columns)