mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-11-28 07:39:49 +08:00
Sanity check for imported settings that may have invalid data. (#1426)
This commit is contained in:
parent
02c08c942d
commit
f3b3e3eded
@ -258,6 +258,12 @@ namespace FancyZonesEditor
|
||||
// Update the "Focus" Default Layout
|
||||
_focusModel.Zones.Clear();
|
||||
|
||||
// Sanity check for imported settings that may have invalid data
|
||||
if (ZoneCount < 1)
|
||||
{
|
||||
ZoneCount = 3;
|
||||
}
|
||||
|
||||
Int32Rect focusZoneRect = new Int32Rect((int)(_focusModel.ReferenceWidth * 0.1), (int)(_focusModel.ReferenceHeight * 0.1), (int)(_focusModel.ReferenceWidth * 0.6), (int)(_focusModel.ReferenceHeight * 0.6));
|
||||
int focusRectXIncrement = (ZoneCount <= 1) ? 0 : (int)(_focusModel.ReferenceWidth * 0.2) / (ZoneCount - 1);
|
||||
int focusRectYIncrement = (ZoneCount <= 1) ? 0 : (int)(_focusModel.ReferenceHeight * 0.2) / (ZoneCount - 1);
|
||||
|
Loading…
Reference in New Issue
Block a user