diff --git a/src/modules/fancyzones/editor/FancyZonesEditor/LayoutPreview.xaml.cs b/src/modules/fancyzones/editor/FancyZonesEditor/LayoutPreview.xaml.cs index a34ac77bf4..cbbb750038 100644 --- a/src/modules/fancyzones/editor/FancyZonesEditor/LayoutPreview.xaml.cs +++ b/src/modules/fancyzones/editor/FancyZonesEditor/LayoutPreview.xaml.cs @@ -261,7 +261,7 @@ namespace FancyZonesEditor private void RenderCanvasPreview(CanvasLayoutModel canvas) { var workArea = canvas.CanvasRect; - if (workArea.Width == 0 || workArea.Height == 0 || App.Overlay.SpanZonesAcrossMonitors) + if (workArea.Width == 0 || workArea.Height == 0) { workArea = App.Overlay.WorkArea; } diff --git a/src/modules/fancyzones/editor/FancyZonesEditor/MainWindow.xaml.cs b/src/modules/fancyzones/editor/FancyZonesEditor/MainWindow.xaml.cs index 210409b39a..dbff7e317d 100644 --- a/src/modules/fancyzones/editor/FancyZonesEditor/MainWindow.xaml.cs +++ b/src/modules/fancyzones/editor/FancyZonesEditor/MainWindow.xaml.cs @@ -304,7 +304,8 @@ namespace FancyZonesEditor } else { - CanvasLayoutModel canvasModel = new CanvasLayoutModel(LayoutNameText.Text, LayoutType.Custom); + var area = App.Overlay.WorkArea; + CanvasLayoutModel canvasModel = new CanvasLayoutModel(LayoutNameText.Text, LayoutType.Custom, (int)area.Width, (int)area.Height); canvasModel.AddZone(); selectedLayoutModel = canvasModel; } diff --git a/src/modules/fancyzones/editor/FancyZonesEditor/Models/CanvasLayoutModel.cs b/src/modules/fancyzones/editor/FancyZonesEditor/Models/CanvasLayoutModel.cs index bb4c916337..e8f13bb7b8 100644 --- a/src/modules/fancyzones/editor/FancyZonesEditor/Models/CanvasLayoutModel.cs +++ b/src/modules/fancyzones/editor/FancyZonesEditor/Models/CanvasLayoutModel.cs @@ -36,6 +36,12 @@ namespace FancyZonesEditor.Models CanvasRect = new Rect(new Size(width, height)); } + public CanvasLayoutModel(string name, LayoutType type, int width, int height) + : base(name, type) + { + CanvasRect = new Rect(new Size(width, height)); + } + public CanvasLayoutModel(string name, LayoutType type) : base(name, type) { @@ -148,6 +154,7 @@ namespace FancyZonesEditor.Models } layout.SensitivityRadius = SensitivityRadius; + layout.CanvasRect = CanvasRect; return layout; } @@ -161,6 +168,7 @@ namespace FancyZonesEditor.Models other._topLeft = _topLeft; other.SensitivityRadius = SensitivityRadius; + other.CanvasRect = CanvasRect; other.UpdateLayout(); }