From 926dfb7253b13e8d3337450a4f8b3d31f7374d05 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Wed, 27 Apr 2016 12:41:49 -0400 Subject: [PATCH] Draw the play or record head in the ruler in their former sizes. --- src/widgets/Ruler.cpp | 19 ++++++++++--------- src/widgets/Ruler.h | 2 +- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/widgets/Ruler.cpp b/src/widgets/Ruler.cpp index 75b508a35..6891feb92 100644 --- a/src/widgets/Ruler.cpp +++ b/src/widgets/Ruler.cpp @@ -1934,6 +1934,7 @@ void AdornedRulerPanel::OnCapture(wxCommandEvent & evt) enum : int { IndicatorSmallWidth = 9, + IndicatorMediumWidth = 13, IndicatorOffset = 1, }; @@ -1986,8 +1987,9 @@ void AdornedRulerPanel::OnPaint(wxPaintEvent & WXUNUSED(evt)) if (mIndType >= 0) { - DoDrawIndicator(&mBackDC, mIndTime, mIndType != 0, - IndicatorBigWidth()); + const bool scrub = mProject->GetScrubber().HasStartedScrubbing(); + auto width = scrub ? IndicatorBigWidth() : IndicatorMediumWidth; + DoDrawIndicator(&mBackDC, mIndTime, mIndType != 0, width, scrub); } if (mViewInfo->selectedRegion.isPoint()) @@ -2763,18 +2765,15 @@ void AdornedRulerPanel::DrawIndicator( double time, bool rec ) } // Draws the play/recording position indicator. -void AdornedRulerPanel::DoDrawIndicator(wxDC * dc, double time, bool playing, int width) +void AdornedRulerPanel::DoDrawIndicator + (wxDC * dc, double time, bool playing, int width, bool scrub) { const int x = Time2Pos(time); AColor::IndicatorColor( dc, playing ); wxPoint tri[ 3 ]; - if (playing && // Don't ever draw the double-head if recording! - (mPrevInScrubZone || - mProject->GetScrubber().HasStartedScrubbing())) { - // Always draw big - width = IndicatorBigWidth(); + if (scrub) { auto height = IndicatorHeightForWidth(width); const int IndicatorHalfWidth = width / 2; @@ -2855,7 +2854,9 @@ void AdornedRulerPanel::DrawQuickPlayIndicator(wxDC * dc) DoEraseIndicator(dc, mLastQuickPlayX); mLastQuickPlayX = x; - DoDrawIndicator(dc, mQuickPlayPos, true, IndicatorSmallWidth); + auto scrub = mPrevInScrubZone || mProject->GetScrubber().HasStartedScrubbing(); + auto width = scrub ? IndicatorBigWidth() : IndicatorSmallWidth; + DoDrawIndicator(dc, mQuickPlayPos, true, width, scrub); } void AdornedRulerPanel::SetPlayRegion(double playRegionStart, diff --git a/src/widgets/Ruler.h b/src/widgets/Ruler.h index 190750c73..626189255 100644 --- a/src/widgets/Ruler.h +++ b/src/widgets/Ruler.h @@ -334,7 +334,7 @@ private: void DoDrawMarks(wxDC * dc, bool /*text */ ); void DoDrawCursor(wxDC * dc); void DoDrawSelection(wxDC * dc); - void DoDrawIndicator(wxDC * dc, double time, bool recording, int width); + 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*/);