From 11df74c2924c9048d1c279281ea8b9668e42a428 Mon Sep 17 00:00:00 2001 From: stefansjfw <57057282+stefansjfw@users.noreply.github.com> Date: Mon, 6 Jul 2020 17:04:40 +0200 Subject: [PATCH] Fix different grid layout shown by editor than the engine (#4758) --- .../fancyzones/editor/FancyZonesEditor/GridEditor.xaml.cs | 3 ++- .../fancyzones/editor/FancyZonesEditor/Models/Settings.cs | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/modules/fancyzones/editor/FancyZonesEditor/GridEditor.xaml.cs b/src/modules/fancyzones/editor/FancyZonesEditor/GridEditor.xaml.cs index b4eb37d084..3a17166166 100644 --- a/src/modules/fancyzones/editor/FancyZonesEditor/GridEditor.xaml.cs +++ b/src/modules/fancyzones/editor/FancyZonesEditor/GridEditor.xaml.cs @@ -568,6 +568,7 @@ namespace FancyZonesEditor left += cellWidth + spacing; } + int zoneNumber = 1; for (int row = 0; row < rows; row++) { for (int col = 0; col < cols; col++) @@ -582,7 +583,7 @@ namespace FancyZonesEditor top = _rowInfo[row].Start; Canvas.SetLeft(zone, left); Canvas.SetTop(zone, top); - zone.LabelID.Content = i + 1; + zone.LabelID.Content = zoneNumber++; int maxRow = row; while (((maxRow + 1) < rows) && (model.CellChildMap[maxRow + 1, col] == i)) diff --git a/src/modules/fancyzones/editor/FancyZonesEditor/Models/Settings.cs b/src/modules/fancyzones/editor/FancyZonesEditor/Models/Settings.cs index f92dc2bc5b..7d4196c0ad 100644 --- a/src/modules/fancyzones/editor/FancyZonesEditor/Models/Settings.cs +++ b/src/modules/fancyzones/editor/FancyZonesEditor/Models/Settings.cs @@ -329,9 +329,9 @@ namespace FancyZonesEditor } 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--; if (index < 0)