From e553837832bc5e51fdc8b6872aea90a3b0155eb7 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Mon, 13 Jul 2015 09:00:56 -0400 Subject: [PATCH] Bug1078: click and drag at the bottom of a stereo track control can resize it... ... just as it does for unlinked tracks. --- src/TrackPanel.cpp | 50 +++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/src/TrackPanel.cpp b/src/TrackPanel.cpp index 21bdea2e1..9b7c44193 100644 --- a/src/TrackPanel.cpp +++ b/src/TrackPanel.cpp @@ -5801,22 +5801,22 @@ bool TrackPanel::PopupFunc(Track * t, wxRect r, int x, int y) /// update the track size. void TrackPanel::HandleResizeClick( wxMouseEvent & event ) { - wxRect r; + wxRect rTrack; wxRect rLabel; // DM: Figure out what track is about to be resized - Track *t = FindTrack(event.m_x, event.m_y, false, false, &r); - Track *label = FindTrack(event.m_x, event.m_y, true, true, &rLabel); + Track *track = FindTrack(event.m_x, event.m_y, false, false, &rTrack); - // If the click is at the bottom of a non-linked track label, we - // treat it as a normal resize. If the label is of a linked track, - // we ignore the click. - - if (label && !label->GetLinked()) { - t = label; + if (!track) { + // This will only return unlinked tracks or left channels of stereo tracks + // or NULL: + track = FindTrack(event.m_x, event.m_y, true, true, &rLabel); + // If stereo, get the right channel. + if (track && track->GetLinked()) + track = track->GetLink(); } - if (!t) { + if (!track) { return; } @@ -5865,34 +5865,34 @@ void TrackPanel::HandleResizeClick( wxMouseEvent & event ) } } #else // EXPERIMENTAL_OUTPUT_DISPLAY - Track *prev = mTracks->GetPrev(t); - Track *next = mTracks->GetNext(t); + Track *prev = mTracks->GetPrev(track); + Track *next = mTracks->GetNext(track); //STM: Determine whether we should rescale one or two tracks - if (prev && prev->GetLink() == t) { + if (prev && prev->GetLink() == track) { // mCapturedTrack is the lower track - mInitialTrackHeight = t->GetHeight(); - mInitialActualHeight = t->GetActualHeight(); - mInitialMinimized = t->GetMinimized(); + mInitialTrackHeight = track->GetHeight(); + mInitialActualHeight = track->GetActualHeight(); + mInitialMinimized = track->GetMinimized(); mInitialUpperTrackHeight = prev->GetHeight(); mInitialUpperActualHeight = prev->GetActualHeight(); - SetCapturedTrack(t, IsResizingBelowLinkedTracks); + SetCapturedTrack(track, IsResizingBelowLinkedTracks); } - else if (next && t->GetLink() == next) { + else if (next && track->GetLink() == next) { // mCapturedTrack is the upper track mInitialTrackHeight = next->GetHeight(); mInitialActualHeight = next->GetActualHeight(); mInitialMinimized = next->GetMinimized(); - mInitialUpperTrackHeight = t->GetHeight(); - mInitialUpperActualHeight = t->GetActualHeight(); - SetCapturedTrack(t, IsResizingBetweenLinkedTracks); + mInitialUpperTrackHeight = track->GetHeight(); + mInitialUpperActualHeight = track->GetActualHeight(); + SetCapturedTrack(track, IsResizingBetweenLinkedTracks); } else { // DM: Save the initial mouse location and the initial height - mInitialTrackHeight = t->GetHeight(); - mInitialActualHeight = t->GetActualHeight(); - mInitialMinimized = t->GetMinimized(); - SetCapturedTrack(t, IsResizing); + mInitialTrackHeight = track->GetHeight(); + mInitialActualHeight = track->GetActualHeight(); + mInitialMinimized = track->GetMinimized(); + SetCapturedTrack(track, IsResizing); } #endif // EXPERIMENTAL_OUTPUT_DISPLAY }