1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-09-18 17:10:55 +02:00

Revert "Remove unused variable"

This reverts commit 0ca907a1a74ee2c5340c981c0392404789730b14.
This commit is contained in:
Paul Licameli 2017-07-18 16:06:25 -04:00
parent 0ca907a1a7
commit 7f289a9ed9
2 changed files with 12 additions and 10 deletions

View File

@ -120,6 +120,7 @@ UIHandlePtr StretchHandle::HitTest
auto selStart = viewInfo.PositionToTime( state.m_x, rect.x );
selStart = std::max(t0, std::min(t1, selStart));
stretchState.mBeatCenter = pTrack->NearestBeatTime( selStart );
bool startNewSelection = true;
if ( within( stretchState.mBeat0.second,
stretchState.mBeatCenter.second, 0.1 ) ) {
stretchState.mMode = stretchLeft;

View File

@ -493,14 +493,12 @@ void SelectHandle::SetUseSnap(bool use)
// Repaint to turn the snap lines on or off
mChangeHighlight = RefreshCode::RefreshAll;
if (IsClicked()) {
if (hasSnap && IsClicked())
// Readjust the moving selection end
AssignSelection(
::GetActiveProject()->GetViewInfo(),
mUseSnap ? mSnapEnd.outTime : mSnapEnd.timeSnappedTime,
nullptr);
mChangeHighlight |= RefreshCode::UpdateSelection;
}
}
bool SelectHandle::HasSnap() const
@ -600,6 +598,7 @@ UIHandle::Result SelectHandle::Click
auto pMixerBoard = pProject->GetMixerBoard();
mSelStart = mUseSnap ? mSnapStart.outTime : mSnapStart.timeSnappedTime;
auto xx = viewInfo.TimeToPosition(mSelStart, mRect.x);
// I. Shift-click adjusts an existing selection
if (bShiftDown || bCtrlDown) {
@ -620,7 +619,7 @@ UIHandle::Result SelectHandle::Click
double value;
// Shift-click, choose closest boundary
SelectionBoundary boundary =
ChooseBoundary(viewInfo, event.m_x, event.m_y, pTrack, mRect, false, false, &value);
ChooseBoundary(viewInfo, xx, event.m_y, pTrack, mRect, false, false, &value);
mSelectionBoundary = boundary;
switch (boundary) {
case SBLeft:
@ -632,7 +631,8 @@ UIHandle::Result SelectHandle::Click
mFreqSelMode = FREQ_SEL_INVALID;
#endif
mSelStartValid = true;
mSelStart = value;
if (!(mUseSnap && mSnapStart.Snapped()))
mSelStart = value;
AdjustSelection(pProject, viewInfo, event.m_x, mRect.x, pTrack);
break;
}
@ -713,7 +713,7 @@ UIHandle::Result SelectHandle::Click
// Not shift-down, choose boundary only within snapping
double value;
SelectionBoundary boundary =
ChooseBoundary(viewInfo, event.m_x, event.m_y, pTrack, mRect, true, true, &value);
ChooseBoundary(viewInfo, xx, event.m_y, pTrack, mRect, true, true, &value);
mSelectionBoundary = boundary;
switch (boundary) {
case SBNone:
@ -727,7 +727,8 @@ UIHandle::Result SelectHandle::Click
mFreqSelMode = FREQ_SEL_INVALID;
#endif
mSelStartValid = true;
mSelStart = value;
if (!(mUseSnap && mSnapStart.Snapped()))
mSelStart = value;
break;
#ifdef EXPERIMENTAL_SPECTRAL_EDITING
case SBBottom:
@ -1177,9 +1178,9 @@ void SelectHandle::AdjustSelection
// using snap-to-time -- then we always accept the snap results)
if (mSnapStart.outCoord >= 0 &&
mSnapEnd.outCoord >= 0 &&
std::abs(mSnapStart.outCoord - mSnapEnd.outCoord) < 3) {
if(!mSnapEnd.snappedTime)
selend = origSelend;
std::abs(mSnapStart.outCoord - mSnapEnd.outCoord) < 3 &&
!mSnapEnd.snappedTime) {
selend = origSelend;
mSnapEnd.outCoord = -1;
}
}