1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-04 17:49:45 +02:00

Bug1065: consistent moving of the selection in time shift

This commit is contained in:
Paul Licameli 2015-08-08 12:25:54 -04:00
parent 65dab6e109
commit 004218fb07

View File

@ -3902,6 +3902,13 @@ void TrackPanel::StartSlide(wxMouseEvent & event)
ToolsToolBar * ttb = mListener->TP_GetToolsToolBar();
bool multiToolModeActive = (ttb && ttb->IsDown(multiTool));
double clickTime =
mViewInfo->PositionToTime(event.m_x, GetLeftOffset());
mCapturedClipIsSelection =
(vt->GetSelected() &&
clickTime > mViewInfo->selectedRegion.t0() &&
clickTime < mViewInfo->selectedRegion.t1());
if ((vt->GetKind() == Track::Wave
#ifdef USE_MIDI
|| vt->GetKind() == Track::Note
@ -3926,18 +3933,9 @@ void TrackPanel::StartSlide(wxMouseEvent & event)
mCapturedClipArray.clear();
double clickTime =
mViewInfo->PositionToTime(event.m_x, GetLeftOffset());
bool clickedInSelection =
(vt->GetSelected() &&
clickTime > mViewInfo->selectedRegion.t0() &&
clickTime < mViewInfo->selectedRegion.t1());
// First, if click was in selection, capture selected clips; otherwise
// just the clicked-on clip
if (clickedInSelection) {
mCapturedClipIsSelection = true;
if (mCapturedClipIsSelection) {
TrackListIterator iter(mTracks);
for (Track *t = iter.First(); t; t = iter.Next()) {
if (t->GetSelected()) {
@ -3946,7 +3944,6 @@ void TrackPanel::StartSlide(wxMouseEvent & event)
}
}
else {
mCapturedClipIsSelection = false;
mCapturedClipArray.push_back(TrackClip(vt, mCapturedClip));
// Check for stereo partner