From a618ec8967f455e53de5763fe7327c6a949803d4 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Wed, 12 Jul 2017 13:36:43 -0400 Subject: [PATCH] Fix priority of multiple hits --- src/TrackPanel.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/TrackPanel.cpp b/src/TrackPanel.cpp index 06d2300da..0774d6d4a 100644 --- a/src/TrackPanel.cpp +++ b/src/TrackPanel.cpp @@ -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();