mirror of
https://github.com/microsoft/PowerToys
synced 2025-08-31 06:25:20 +00:00
Sanity check for imported settings that may have invalid data. (#1426)
This commit is contained in:
@@ -258,6 +258,12 @@ namespace FancyZonesEditor
|
|||||||
// Update the "Focus" Default Layout
|
// Update the "Focus" Default Layout
|
||||||
_focusModel.Zones.Clear();
|
_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));
|
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 focusRectXIncrement = (ZoneCount <= 1) ? 0 : (int)(_focusModel.ReferenceWidth * 0.2) / (ZoneCount - 1);
|
||||||
int focusRectYIncrement = (ZoneCount <= 1) ? 0 : (int)(_focusModel.ReferenceHeight * 0.2) / (ZoneCount - 1);
|
int focusRectYIncrement = (ZoneCount <= 1) ? 0 : (int)(_focusModel.ReferenceHeight * 0.2) / (ZoneCount - 1);
|
||||||
|
Reference in New Issue
Block a user