mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 12:18:50 +02:00
[FZEditor] Canvas layout width/height resize fix (#20099)
This commit is contained in:
@@ -53,7 +53,6 @@ namespace FancyZonesEditor
|
|||||||
_model = model;
|
_model = model;
|
||||||
|
|
||||||
var workArea = App.Overlay.WorkArea;
|
var workArea = App.Overlay.WorkArea;
|
||||||
_model.ScaleLayout(workAreaWidth: workArea.Width, workAreaHeight: workArea.Height);
|
|
||||||
|
|
||||||
UpdateZoneRects();
|
UpdateZoneRects();
|
||||||
|
|
||||||
|
|||||||
@@ -264,7 +264,9 @@ namespace FancyZonesEditor
|
|||||||
private void RenderCanvasPreview(CanvasLayoutModel canvas)
|
private void RenderCanvasPreview(CanvasLayoutModel canvas)
|
||||||
{
|
{
|
||||||
var screenWorkArea = App.Overlay.WorkArea;
|
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
|
Viewbox viewbox = new Viewbox
|
||||||
{
|
{
|
||||||
@@ -278,7 +280,7 @@ namespace FancyZonesEditor
|
|||||||
};
|
};
|
||||||
viewbox.Child = frame;
|
viewbox.Child = frame;
|
||||||
|
|
||||||
foreach (Int32Rect zone in canvas.Zones)
|
foreach (Int32Rect zone in renderLayout.Zones)
|
||||||
{
|
{
|
||||||
Border rect = new Border();
|
Border rect = new Border();
|
||||||
Canvas.SetTop(rect, zone.Y);
|
Canvas.SetTop(rect, zone.Y);
|
||||||
|
|||||||
Reference in New Issue
Block a user