mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-04 10:16:24 +02:00
[FancyZones] Overlapping zones selection algorithm - settings (#9874)
* Started work * Removed bools in favor of an enum, renamed some * Done something but it still doesn't work * Settings are now correctly saved * I'm getting a crash, I need to rebuild from scratch * Settings page looks alright * Completed work. Unit tests? * Use ComboBox instead * Add telemetry * Update text
This commit is contained in:
@@ -257,14 +257,16 @@ ZoneSet::ZonesFromPoint(POINT pt) const noexcept
|
||||
|
||||
try
|
||||
{
|
||||
using Algorithm = Settings::OverlappingZonesAlgorithm;
|
||||
|
||||
switch (m_config.SelectionAlgorithm)
|
||||
{
|
||||
case ZoneSelectionAlgorithm::SUBREGION:
|
||||
return ZoneSelectSubregion(capturedZones, pt);
|
||||
case ZoneSelectionAlgorithm::SMALLEST:
|
||||
case Algorithm::Smallest:
|
||||
return ZoneSelectPriority(capturedZones, [&](auto zone1, auto zone2) { return zoneArea(zone1) < zoneArea(zone2); });
|
||||
case ZoneSelectionAlgorithm::LARGEST:
|
||||
case Algorithm::Largest:
|
||||
return ZoneSelectPriority(capturedZones, [&](auto zone1, auto zone2) { return zoneArea(zone1) > zoneArea(zone2); });
|
||||
case Algorithm::Positional:
|
||||
return ZoneSelectSubregion(capturedZones, pt);
|
||||
}
|
||||
}
|
||||
catch (std::out_of_range)
|
||||
|
||||
Reference in New Issue
Block a user