mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 11:16:51 +02:00
[FancyZones] Prevent snapping to invalid zone (#28206)
This commit is contained in:
@@ -124,6 +124,14 @@ bool WorkArea::Snap(HWND window, const ZoneIndexSet& zones, bool updatePosition)
|
||||
return false;
|
||||
}
|
||||
|
||||
for (ZoneIndex zone : zones)
|
||||
{
|
||||
if (static_cast<size_t>(zone) >= m_layout->Zones().size())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
m_layoutWindows.Assign(window, zones);
|
||||
AppZoneHistory::instance().SetAppLastZones(window, m_uniqueId, m_layout->Id(), zones);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user