mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-10 21:41:51 +02:00
Fix difference in editor and applied focus layout zones size and increments (#5601)
This commit is contained in:
@@ -293,6 +293,8 @@ namespace FancyZonesEditor
|
|||||||
ZoneCount = 3;
|
ZoneCount = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If changing focus layout zones size and/or increment,
|
||||||
|
// same change should be applied in ZoneSet.cpp (ZoneSet::CalculateFocusLayout)
|
||||||
Int32Rect focusZoneRect = new Int32Rect(100, 100, (int)(WorkArea.Width * 0.4), (int)(WorkArea.Height * 0.4));
|
Int32Rect focusZoneRect = new Int32Rect(100, 100, (int)(WorkArea.Width * 0.4), (int)(WorkArea.Height * 0.4));
|
||||||
int focusRectXIncrement = (ZoneCount <= 1) ? 0 : 50;
|
int focusRectXIncrement = (ZoneCount <= 1) ? 0 : 50;
|
||||||
int focusRectYIncrement = (ZoneCount <= 1) ? 0 : 50;
|
int focusRectYIncrement = (ZoneCount <= 1) ? 0 : 50;
|
||||||
|
|||||||
@@ -423,15 +423,15 @@ bool ZoneSet::CalculateFocusLayout(Rect workArea, int zoneCount) noexcept
|
|||||||
{
|
{
|
||||||
bool success = true;
|
bool success = true;
|
||||||
|
|
||||||
long left{ long(workArea.width() * 0.1) };
|
long left{ 100 };
|
||||||
long top{ long(workArea.height() * 0.1) };
|
long top{ 100 };
|
||||||
long right{ left + long(workArea.width() * 0.6) };
|
long right{ left + long(workArea.width() * 0.4) };
|
||||||
long bottom{ top + long(workArea.height() * 0.6) };
|
long bottom{ top + long(workArea.height() * 0.4) };
|
||||||
|
|
||||||
RECT focusZoneRect{ left, top, right, bottom };
|
RECT focusZoneRect{ left, top, right, bottom };
|
||||||
|
|
||||||
long focusRectXIncrement = (zoneCount <= 1) ? 0 : (int)(workArea.width() * 0.2) / (zoneCount - 1);
|
long focusRectXIncrement = (zoneCount <= 1) ? 0 : 50;
|
||||||
long focusRectYIncrement = (zoneCount <= 1) ? 0 : (int)(workArea.height() * 0.2) / (zoneCount - 1);
|
long focusRectYIncrement = (zoneCount <= 1) ? 0 : 50;
|
||||||
|
|
||||||
if (left >= right || top >= bottom || left < 0 || right < 0 || top < 0 || bottom < 0)
|
if (left >= right || top >= bottom || left < 0 || right < 0 || top < 0 || bottom < 0)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user