From b30093a606ac21425e4fe2626fca0f64994b2f7a Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Sat, 30 Apr 2016 09:47:09 -0400 Subject: [PATCH] Fix the bounce in play indicator when drag selection snaps to zero width... ... This problem was introduced at 3dec7153a30ce58d23e42d122362cd6f86c37ca8. Also fix the mistake of painting to the wrong dc in some new code. --- src/widgets/Ruler.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/widgets/Ruler.cpp b/src/widgets/Ruler.cpp index 3824968e0..790f901c3 100644 --- a/src/widgets/Ruler.cpp +++ b/src/widgets/Ruler.cpp @@ -2129,6 +2129,7 @@ void AdornedRulerPanel::OnMouseEvents(wxMouseEvent &evt) wxCoord xx = evt.GetX(); wxCoord mousePosX = xx; UpdateQuickPlayPos(mousePosX); + HandleSnapping(); // If not looping, restrict selection to end of project if (!inScrubZone && !evt.ShiftDown()) { @@ -2257,12 +2258,6 @@ void AdornedRulerPanel::OnMouseEvents(wxMouseEvent &evt) } } - HandleSnapping(); - - mQuickPlayInd = true; - wxClientDC dc(this); - DrawQuickPlayIndicator(&dc); - if (evt.LeftDown()) { // Temporarily unlock locked play region @@ -2486,6 +2481,10 @@ void AdornedRulerPanel::OnMouseEvents(wxMouseEvent &evt) mPlayRegionLock = false; } } + + mQuickPlayInd = true; + wxClientDC dc(this); + DrawQuickPlayIndicator(&dc); } void AdornedRulerPanel::UpdateStatusBar(StatusChoice choice) @@ -2762,8 +2761,8 @@ void AdornedRulerPanel::DoDrawBorder(wxDC * dc) if (mShowScrubbing) { // Let's distinguish the scrubbing area by using the same gray as for // selected track control panel. - AColor::Medium(&mBackDC, true); - mBackDC.DrawRectangle(mScrubZone); + AColor::Medium(dc, true); + dc->DrawRectangle(mScrubZone); } wxRect r = mOuter;