[FancyZones editor] Fix CanvasRect not being initialized (#10163)

* Fix CanvasRect not being initialized

* No need to use workArea height if it's set in CanvasLayoutModel
This commit is contained in:
Ivan Stošić
2021-03-11 10:50:53 +01:00
committed by GitHub
parent 72da703f0e
commit 488ee19f93
3 changed files with 11 additions and 2 deletions

View File

@@ -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();
}