Fix reversed order of zones in layout (#1071)

This commit is contained in:
vldmr11080 2020-01-15 20:20:10 +01:00 committed by GitHub
parent 588f134de8
commit 5dc60b9f35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -49,7 +49,7 @@ IFACEMETHODIMP_(winrt::com_ptr<IZone>) ZoneSet::ZoneFromPoint(POINT pt) noexcept
winrt::com_ptr<IZone> smallestKnownZone = nullptr; winrt::com_ptr<IZone> smallestKnownZone = nullptr;
// To reduce redundant calculations, we will store the last known zones area. // To reduce redundant calculations, we will store the last known zones area.
int smallestKnownZoneArea = INT32_MAX; int smallestKnownZoneArea = INT32_MAX;
for (auto iter = m_zones.begin(); iter != m_zones.end(); iter++) for (auto iter = m_zones.rbegin(); iter != m_zones.rend(); iter++)
{ {
if (winrt::com_ptr<IZone> zone = iter->try_as<IZone>()) if (winrt::com_ptr<IZone> zone = iter->try_as<IZone>())
{ {

View File

@ -553,7 +553,7 @@ void ZoneWindow::DrawActiveZoneSet(wil::unique_hdc& hdc, RECT const& clientRect)
auto zones = m_activeZoneSet->GetZones(); auto zones = m_activeZoneSet->GetZones();
const size_t maxColorIndex = min(size(zones) - 1, size(colors) - 1); const size_t maxColorIndex = min(size(zones) - 1, size(colors) - 1);
size_t colorIndex = maxColorIndex; size_t colorIndex = maxColorIndex;
for (auto iter = zones.rbegin(); iter != zones.rend(); iter++) for (auto iter = zones.begin(); iter != zones.end(); iter++)
{ {
winrt::com_ptr<IZone> zone = iter->try_as<IZone>(); winrt::com_ptr<IZone> zone = iter->try_as<IZone>();
if (!zone) if (!zone)