From 4170398887ac999801b0f77187680a09952aa235 Mon Sep 17 00:00:00 2001 From: James Kolpack Date: Thu, 16 Jan 2020 10:24:34 -0500 Subject: [PATCH] Fix issue with scaling chart renders --- WebCms/Controllers/ChartController.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/WebCms/Controllers/ChartController.cs b/WebCms/Controllers/ChartController.cs index e96df8d..890623f 100644 --- a/WebCms/Controllers/ChartController.cs +++ b/WebCms/Controllers/ChartController.cs @@ -182,8 +182,11 @@ namespace LeafWeb.WebCms.Controllers var currentRow = 0; foreach (var image in bitmaps) { - g.DrawImage(image, currentCol * cellWidth, currentRow * cellHeight); - + // https://stackoverflow.com/a/41189062/99492 + g.DrawImage(image, + currentCol * cellWidth, currentRow * cellHeight, + cellWidth, cellHeight); + currentCol = (currentCol + 1)%columnCount; currentRow += currentCol == 0 ? 1 : 0; }