1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-25 08:58:06 +02:00

Fix priority of multiple hits

This commit is contained in:
Paul Licameli 2017-07-12 13:36:43 -04:00
parent c1cd324848
commit a618ec8967

View File

@ -915,6 +915,7 @@ void TrackPanel::HandleMotion
}
auto oldHandle = Target();
auto oldPosition = mTarget;
// Now do the
// UIHANDLE HIT TEST !
@ -926,8 +927,12 @@ void TrackPanel::HandleMotion
if (oldHandle) {
auto begin = mTargets.begin(), end = mTargets.end(),
iter = std::find(begin, end, oldHandle);
if (iter != end)
mTarget = iter - begin;
if (iter != end) {
auto newPosition = iter - begin;
if (newPosition <= oldPosition)
mTarget = newPosition;
// else, some new hit and this position takes priority
}
}
handle = Target();