Fix difference in editor and applied focus layout zones size and increments (#5601)

This commit is contained in:
stefansjfw 2020-08-06 16:41:15 +02:00 committed by GitHub
parent 1d8ca28152
commit f50a8e5252
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 6 deletions

View file

@ -293,6 +293,8 @@ namespace FancyZonesEditor
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));
int focusRectXIncrement = (ZoneCount <= 1) ? 0 : 50;
int focusRectYIncrement = (ZoneCount <= 1) ? 0 : 50;

View file

@ -423,15 +423,15 @@ bool ZoneSet::CalculateFocusLayout(Rect workArea, int zoneCount) noexcept
{
bool success = true;
long left{ long(workArea.width() * 0.1) };
long top{ long(workArea.height() * 0.1) };
long right{ left + long(workArea.width() * 0.6) };
long bottom{ top + long(workArea.height() * 0.6) };
long left{ 100 };
long top{ 100 };
long right{ left + long(workArea.width() * 0.4) };
long bottom{ top + long(workArea.height() * 0.4) };
RECT focusZoneRect{ left, top, right, bottom };
long focusRectXIncrement = (zoneCount <= 1) ? 0 : (int)(workArea.width() * 0.2) / (zoneCount - 1);
long focusRectYIncrement = (zoneCount <= 1) ? 0 : (int)(workArea.height() * 0.2) / (zoneCount - 1);
long focusRectXIncrement = (zoneCount <= 1) ? 0 : 50;
long focusRectYIncrement = (zoneCount <= 1) ? 0 : 50;
if (left >= right || top >= bottom || left < 0 || right < 0 || top < 0 || bottom < 0)
{