Shift+TAB cycles hit test targets backwards

This commit is contained in:
Paul Licameli 2017-07-12 16:39:14 -04:00
parent 8d13bf1d83
commit 6c0b3bb1bf
2 changed files with 10 additions and 5 deletions

View File

@ -976,12 +976,17 @@ bool TrackPanel::HasRotation() const
return !mUIHandle && mTargets.size() > 1;
}
void TrackPanel::RotateTarget()
void TrackPanel::RotateTarget(bool forward)
{
auto size = mTargets.size();
if (size > 1) {
mTarget = (mTarget + 1) % size;
Target()->Enter();
if (forward)
++mTarget;
else
mTarget += size - 1;
mTarget %= size;
if (Target())
Target()->Enter();
}
}
@ -1391,7 +1396,7 @@ void TrackPanel::OnKeyDown(wxKeyEvent & event)
case WXK_TAB:
if ( HasRotation() ) {
RotateTarget();
RotateTarget( !event.ShiftDown() );
HandleCursorForPresentMouseState(false);
return;
}

View File

@ -551,7 +551,7 @@ protected:
bool HasRotation() const;
void RotateTarget();
void RotateTarget(bool forward);
std::weak_ptr<Track> mpClickedTrack;
UIHandlePtr mUIHandle;