From 2cbd1a6a2bf834b9189c75dbf9281b59b512c666 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Tue, 3 May 2016 11:01:22 -0400 Subject: [PATCH] Revert "Triangle always, above numbers, for play position, even if scrubbing; ..." This reverts commit 3d70be6cd632aa22521ed2108e07bd5ca02cada7, reversing changes made to ebd9820b50c07d0eef98567b9fda4f629e4a5be4. --- src/widgets/Ruler.cpp | 20 +++++++++----------- src/widgets/Ruler.h | 2 +- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/widgets/Ruler.cpp b/src/widgets/Ruler.cpp index 31abd3451..2cd02b2b6 100644 --- a/src/widgets/Ruler.cpp +++ b/src/widgets/Ruler.cpp @@ -2100,7 +2100,7 @@ void AdornedRulerPanel::OnPaint(wxPaintEvent & WXUNUSED(evt)) { const bool scrub = mProject->GetScrubber().HasStartedScrubbing(); auto width = scrub ? IndicatorBigWidth() : IndicatorMediumWidth; - DoDrawIndicator(&mBackDC, mIndTime, mIndType != 0, width, false); + DoDrawIndicator(&mBackDC, mIndTime, mIndType != 0, width, scrub); } if (mViewInfo->selectedRegion.isPoint()) @@ -2118,7 +2118,7 @@ void AdornedRulerPanel::OnPaint(wxPaintEvent & WXUNUSED(evt)) if (mQuickPlayInd) { - DrawQuickPlayIndicator(&dc, true); + DrawQuickPlayIndicator(&dc); } } @@ -3261,11 +3261,11 @@ void AdornedRulerPanel::DoDrawIndicator auto height = IndicatorHeightForWidth(width); const int IndicatorHalfWidth = width / 2; tri[ 0 ].x = x - IndicatorHalfWidth; - tri[ 0 ].y = mInner.y; + tri[ 0 ].y = mScrubZone.y; tri[ 1 ].x = x + IndicatorHalfWidth; - tri[ 1 ].y = mInner.y; + tri[ 1 ].y = mScrubZone.y; tri[ 2 ].x = x; - tri[ 2 ].y = mInner.y + height; + tri[ 2 ].y = mScrubZone.y + height; dc->DrawPolygon( 3, tri ); } } @@ -3283,10 +3283,10 @@ void AdornedRulerPanel::DoEraseIndicator(wxDC *dc, int x) // Restore the background, but make it a little oversized to make // it happy OSX. auto xx = x - indsize - 1; - auto yy = 0; + auto yy = mScrubZone.y - 1; dc->Blit(xx, yy, indsize * 2 + 1 + 2, - GetSize().GetHeight(), + mScrubZone.y + height + 2, &mBackDC, xx, yy); } @@ -3303,7 +3303,7 @@ QuickPlayIndicatorOverlay *AdornedRulerPanel::GetOverlay() } // Draws the vertical line and green triangle indicating the Quick Play cursor position. -void AdornedRulerPanel::DrawQuickPlayIndicator(wxDC * dc, bool repainting) +void AdornedRulerPanel::DrawQuickPlayIndicator(wxDC * dc) { double latestEnd = std::max(mTracks->GetEndTime(), mProject->GetSel1()); if (dc == NULL || (mQuickPlayPos >= latestEnd)) { @@ -3318,9 +3318,7 @@ void AdornedRulerPanel::DrawQuickPlayIndicator(wxDC * dc, bool repainting) !mProject->GetScrubber().IsScrubbing(); GetOverlay()->Update(x, mIsSnapped, previewScrub); - if (!repainting) - DoEraseIndicator(dc, mLastQuickPlayX); - + DoEraseIndicator(dc, mLastQuickPlayX); mLastQuickPlayX = x; auto scrub = mPrevZone == StatusChoice::EnteringScrubZone || diff --git a/src/widgets/Ruler.h b/src/widgets/Ruler.h index a10525e6b..892e43f91 100644 --- a/src/widgets/Ruler.h +++ b/src/widgets/Ruler.h @@ -367,7 +367,7 @@ private: void DoDrawIndicator(wxDC * dc, double time, bool playing, int width, bool scrub); void DoEraseIndicator(wxDC *dc, int x); QuickPlayIndicatorOverlay *GetOverlay(); - void DrawQuickPlayIndicator(wxDC * dc /*NULL to DELETE old only*/, bool repainting = false); + void DrawQuickPlayIndicator(wxDC * dc /*NULL to DELETE old only*/); void DoDrawPlayRegion(wxDC * dc); wxRect GetButtonAreaRect(bool includeBorder = false) const;