Fix different grid layout shown by editor than the engine (#4758)

This commit is contained in:
stefansjfw
2020-07-06 17:04:40 +02:00
committed by GitHub
parent a935d69408
commit 11df74c292
2 changed files with 4 additions and 3 deletions

View File

@@ -568,6 +568,7 @@ namespace FancyZonesEditor
left += cellWidth + spacing; left += cellWidth + spacing;
} }
int zoneNumber = 1;
for (int row = 0; row < rows; row++) for (int row = 0; row < rows; row++)
{ {
for (int col = 0; col < cols; col++) for (int col = 0; col < cols; col++)
@@ -582,7 +583,7 @@ namespace FancyZonesEditor
top = _rowInfo[row].Start; top = _rowInfo[row].Start;
Canvas.SetLeft(zone, left); Canvas.SetLeft(zone, left);
Canvas.SetTop(zone, top); Canvas.SetTop(zone, top);
zone.LabelID.Content = i + 1; zone.LabelID.Content = zoneNumber++;
int maxRow = row; int maxRow = row;
while (((maxRow + 1) < rows) && (model.CellChildMap[maxRow + 1, col] == i)) while (((maxRow + 1) < rows) && (model.CellChildMap[maxRow + 1, col] == i))

View File

@@ -329,9 +329,9 @@ namespace FancyZonesEditor
} }
int index = ZoneCount - 1; int index = ZoneCount - 1;
for (int row = rows - 1; row >= 0; row--) for (int col = cols - 1; col >= 0; col--)
{ {
for (int col = cols - 1; col >= 0; col--) for (int row = rows - 1; row >= 0; row--)
{ {
_gridModel.CellChildMap[row, col] = index--; _gridModel.CellChildMap[row, col] = index--;
if (index < 0) if (index < 0)