Allow selecting multiple adjacent zones even when they slightly overlap (#4974)

This commit is contained in:
Ivan Stošić 2020-07-14 14:51:24 +02:00 committed by GitHub
parent 5f0e8d3d8e
commit 39b0401c55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -208,8 +208,8 @@ ZoneSet::ZonesFromPoint(POINT pt) noexcept
{
auto rectI = m_zones[capturedZones[i]]->GetZoneRect();
auto rectJ = m_zones[capturedZones[j]]->GetZoneRect();
if (max(rectI.top, rectJ.top) < min(rectI.bottom, rectJ.bottom) &&
max(rectI.left, rectJ.left) < min(rectI.right, rectJ.right))
if (max(rectI.top, rectJ.top) + SENSITIVITY_RADIUS < min(rectI.bottom, rectJ.bottom) &&
max(rectI.left, rectJ.left) + SENSITIVITY_RADIUS < min(rectI.right, rectJ.right))
{
overlap = true;
i = capturedZones.size() - 1;