1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-22 15:20:15 +02:00

Triangle always, above numbers, for play position, even if scrubbing; ...

This commit is contained in:
Paul Licameli 2016-05-03 10:58:31 -04:00
commit 3d70be6cd6
2 changed files with 12 additions and 10 deletions

View File

@ -2100,7 +2100,7 @@ void AdornedRulerPanel::OnPaint(wxPaintEvent & WXUNUSED(evt))
{ {
const bool scrub = mProject->GetScrubber().HasStartedScrubbing(); const bool scrub = mProject->GetScrubber().HasStartedScrubbing();
auto width = scrub ? IndicatorBigWidth() : IndicatorMediumWidth; auto width = scrub ? IndicatorBigWidth() : IndicatorMediumWidth;
DoDrawIndicator(&mBackDC, mIndTime, mIndType != 0, width, scrub); DoDrawIndicator(&mBackDC, mIndTime, mIndType != 0, width, false);
} }
if (mViewInfo->selectedRegion.isPoint()) if (mViewInfo->selectedRegion.isPoint())
@ -2118,7 +2118,7 @@ void AdornedRulerPanel::OnPaint(wxPaintEvent & WXUNUSED(evt))
if (mQuickPlayInd) if (mQuickPlayInd)
{ {
DrawQuickPlayIndicator(&dc); DrawQuickPlayIndicator(&dc, true);
} }
} }
@ -3261,11 +3261,11 @@ void AdornedRulerPanel::DoDrawIndicator
auto height = IndicatorHeightForWidth(width); auto height = IndicatorHeightForWidth(width);
const int IndicatorHalfWidth = width / 2; const int IndicatorHalfWidth = width / 2;
tri[ 0 ].x = x - IndicatorHalfWidth; tri[ 0 ].x = x - IndicatorHalfWidth;
tri[ 0 ].y = mScrubZone.y; tri[ 0 ].y = mInner.y;
tri[ 1 ].x = x + IndicatorHalfWidth; tri[ 1 ].x = x + IndicatorHalfWidth;
tri[ 1 ].y = mScrubZone.y; tri[ 1 ].y = mInner.y;
tri[ 2 ].x = x; tri[ 2 ].x = x;
tri[ 2 ].y = mScrubZone.y + height; tri[ 2 ].y = mInner.y + height;
dc->DrawPolygon( 3, tri ); 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 // Restore the background, but make it a little oversized to make
// it happy OSX. // it happy OSX.
auto xx = x - indsize - 1; auto xx = x - indsize - 1;
auto yy = mScrubZone.y - 1; auto yy = 0;
dc->Blit(xx, yy, dc->Blit(xx, yy,
indsize * 2 + 1 + 2, indsize * 2 + 1 + 2,
mScrubZone.y + height + 2, GetSize().GetHeight(),
&mBackDC, &mBackDC,
xx, yy); xx, yy);
} }
@ -3303,7 +3303,7 @@ QuickPlayIndicatorOverlay *AdornedRulerPanel::GetOverlay()
} }
// Draws the vertical line and green triangle indicating the Quick Play cursor position. // Draws the vertical line and green triangle indicating the Quick Play cursor position.
void AdornedRulerPanel::DrawQuickPlayIndicator(wxDC * dc) void AdornedRulerPanel::DrawQuickPlayIndicator(wxDC * dc, bool repainting)
{ {
double latestEnd = std::max(mTracks->GetEndTime(), mProject->GetSel1()); double latestEnd = std::max(mTracks->GetEndTime(), mProject->GetSel1());
if (dc == NULL || (mQuickPlayPos >= latestEnd)) { if (dc == NULL || (mQuickPlayPos >= latestEnd)) {
@ -3318,7 +3318,9 @@ void AdornedRulerPanel::DrawQuickPlayIndicator(wxDC * dc)
!mProject->GetScrubber().IsScrubbing(); !mProject->GetScrubber().IsScrubbing();
GetOverlay()->Update(x, mIsSnapped, previewScrub); GetOverlay()->Update(x, mIsSnapped, previewScrub);
DoEraseIndicator(dc, mLastQuickPlayX); if (!repainting)
DoEraseIndicator(dc, mLastQuickPlayX);
mLastQuickPlayX = x; mLastQuickPlayX = x;
auto scrub = mPrevZone == StatusChoice::EnteringScrubZone || auto scrub = mPrevZone == StatusChoice::EnteringScrubZone ||

View File

@ -367,7 +367,7 @@ private:
void DoDrawIndicator(wxDC * dc, double time, bool playing, int width, bool scrub); void DoDrawIndicator(wxDC * dc, double time, bool playing, int width, bool scrub);
void DoEraseIndicator(wxDC *dc, int x); void DoEraseIndicator(wxDC *dc, int x);
QuickPlayIndicatorOverlay *GetOverlay(); QuickPlayIndicatorOverlay *GetOverlay();
void DrawQuickPlayIndicator(wxDC * dc /*NULL to DELETE old only*/); void DrawQuickPlayIndicator(wxDC * dc /*NULL to DELETE old only*/, bool repainting = false);
void DoDrawPlayRegion(wxDC * dc); void DoDrawPlayRegion(wxDC * dc);
wxRect GetButtonAreaRect(bool includeBorder = false) const; wxRect GetButtonAreaRect(bool includeBorder = false) const;