[FZEditor] Canvas layout width/height resize fix (#20099)

This commit is contained in:
Seraphima Zykova 2022-08-29 20:18:00 +02:00 committed by GitHub
parent 56264eb089
commit c0d5f36224
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -53,7 +53,6 @@ namespace FancyZonesEditor
_model = model;
var workArea = App.Overlay.WorkArea;
_model.ScaleLayout(workAreaWidth: workArea.Width, workAreaHeight: workArea.Height);
UpdateZoneRects();

View File

@ -264,7 +264,9 @@ namespace FancyZonesEditor
private void RenderCanvasPreview(CanvasLayoutModel canvas)
{
var screenWorkArea = App.Overlay.WorkArea;
canvas.ScaleLayout(workAreaWidth: screenWorkArea.Width, workAreaHeight: screenWorkArea.Height);
var renderLayout = (CanvasLayoutModel)canvas.Clone();
renderLayout.ScaleLayout(workAreaWidth: screenWorkArea.Width, workAreaHeight: screenWorkArea.Height);
Viewbox viewbox = new Viewbox
{
@ -278,7 +280,7 @@ namespace FancyZonesEditor
};
viewbox.Child = frame;
foreach (Int32Rect zone in canvas.Zones)
foreach (Int32Rect zone in renderLayout.Zones)
{
Border rect = new Border();
Canvas.SetTop(rect, zone.Y);