mirror of
https://github.com/cookiengineer/audacity
synced 2025-09-08 08:30:02 +02:00
bug 310 - fix initial shift-selection conditions
This commit is contained in:
parent
c576fc4893
commit
98182821d6
@ -1819,6 +1819,8 @@ void TrackPanel::HandleSelect(wxMouseEvent & event)
|
|||||||
void TrackPanel::SelectionHandleClick(wxMouseEvent & event,
|
void TrackPanel::SelectionHandleClick(wxMouseEvent & event,
|
||||||
Track * pTrack, wxRect r)
|
Track * pTrack, wxRect r)
|
||||||
{
|
{
|
||||||
|
Track *rightTrack = NULL;
|
||||||
|
bool nextTrackIsLinkFromPTrack = false;
|
||||||
mCapturedTrack = pTrack;
|
mCapturedTrack = pTrack;
|
||||||
mCapturedRect = r;
|
mCapturedRect = r;
|
||||||
|
|
||||||
@ -1854,14 +1856,25 @@ void TrackPanel::SelectionHandleClick(wxMouseEvent & event,
|
|||||||
double selend = PositionToTime(event.m_x, r.x);
|
double selend = PositionToTime(event.m_x, r.x);
|
||||||
|
|
||||||
TrackListIterator iter(mTracks);
|
TrackListIterator iter(mTracks);
|
||||||
for (Track *t = iter.First(); t; t = iter.Next())
|
for (Track *t = iter.First(); t; t = iter.Next()) {
|
||||||
if (t->GetSelected()) {
|
if (t->GetSelected()) {
|
||||||
isAtLeastOneTrackSelected = true;
|
isAtLeastOneTrackSelected = true;
|
||||||
break;
|
break;
|
||||||
|
} else if (t == pTrack && t->GetLinked()) {
|
||||||
|
nextTrackIsLinkFromPTrack = true;
|
||||||
|
} else if (nextTrackIsLinkFromPTrack) {
|
||||||
|
rightTrack = t;
|
||||||
|
nextTrackIsLinkFromPTrack = false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!isAtLeastOneTrackSelected)
|
if (!isAtLeastOneTrackSelected) {
|
||||||
pTrack->SetSelected(true);
|
pTrack->SetSelected(true);
|
||||||
|
if (rightTrack)
|
||||||
|
rightTrack->SetSelected(true);
|
||||||
|
else if (pTrack->GetLink())
|
||||||
|
pTrack->GetLink()->SetSelected(true);
|
||||||
|
}
|
||||||
|
|
||||||
// Edit the selection boundary nearest the mouse click.
|
// Edit the selection boundary nearest the mouse click.
|
||||||
if (fabs(selend - mViewInfo->sel0) < fabs(selend - mViewInfo->sel1))
|
if (fabs(selend - mViewInfo->sel0) < fabs(selend - mViewInfo->sel1))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user