From bdee9dd0c92865e0cec2f4bbf170959df282a930 Mon Sep 17 00:00:00 2001 From: rtk0c Date: Fri, 11 Jun 2021 22:19:23 -0700 Subject: More UI polishing and fix asset saving/reloading --- core/src/Model/Template/TableTemplate.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'core/src/Model/Template/TableTemplate.cpp') diff --git a/core/src/Model/Template/TableTemplate.cpp b/core/src/Model/Template/TableTemplate.cpp index 28a4d6e..f2524a0 100644 --- a/core/src/Model/Template/TableTemplate.cpp +++ b/core/src/Model/Template/TableTemplate.cpp @@ -88,17 +88,15 @@ void TableTemplate::Resize(int newWidth, int newHeight) int tableWidth = GetTableWidth(); int tableHeight = GetTableHeight(); - int yEnd = std::min(tableHeight, newHeight); - int xEnd = std::min(tableWidth, newWidth); - for (int y = 0; y < yEnd; ++y) { + for (int y = 0; y < newHeight; ++y) { if (y >= tableHeight) { - for (int x = 0; x < xEnd; ++x) { + for (int x = 0; x < newWidth; ++x) { cells.push_back(TableCell{}); } continue; } - for (int x = 0; x < xEnd; ++x) { + for (int x = 0; x < newWidth; ++x) { if (x >= tableWidth) { cells.push_back(TableCell{}); } else { @@ -109,6 +107,8 @@ void TableTemplate::Resize(int newWidth, int newHeight) } mCells = std::move(cells); + mColumnWidths.resize(newWidth); + mRowHeights.resize(newHeight); } int TableTemplate::GetRowHeight(int row) const -- cgit v1.2.3-70-g09d2