From 17e3bf7b096fc811fd763bafc5555eab9b8e7932 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Sat, 8 Aug 2015 16:35:49 -0400 Subject: [PATCH] Bug752: yellow snap lines should erase when mouse-up is not over a track --- src/TrackPanel.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/TrackPanel.cpp b/src/TrackPanel.cpp index 996a6b050..671ea7131 100644 --- a/src/TrackPanel.cpp +++ b/src/TrackPanel.cpp @@ -2148,8 +2148,11 @@ void TrackPanel::HandleSelect(wxMouseEvent & event) delete mSnapManager; mSnapManager = NULL; } - mSnapLeft = -1; - mSnapRight = -1; + // Do not draw yellow lines + if (mSnapLeft != -1 || mSnapRight != -1) { + mSnapLeft = mSnapRight = -1; + Refresh(false); + } SetCapturedTrack( NULL ); //Send the new selection state to the undo/redo stack: @@ -2846,8 +2849,8 @@ void TrackPanel::StartSelection(int mouseXCoordinate, int trackLeftEdge) bool snappedPoint, snappedTime; if (mSnapManager->Snap(mCapturedTrack, mSelStart, false, &s, &snappedPoint, &snappedTime)) { - if (snappedPoint) - mSnapLeft = mViewInfo->TimeToPosition(s, trackLeftEdge); + //if (snappedPoint) + //mSnapLeft = mViewInfo->TimeToPosition(s, trackLeftEdge); } } @@ -3857,8 +3860,12 @@ void TrackPanel::HandleSlide(wxMouseEvent & event) delete mSnapManager; mSnapManager = NULL; } - mSnapLeft = -1; - mSnapRight = -1; + + // Do not draw yellow lines + if (mSnapLeft != -1 || mSnapRight != -1) { + mSnapLeft = mSnapRight = -1; + Refresh(false); + } if (!mDidSlideVertically && mHSlideAmount==0) return;