mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-24 00:18:07 +02:00
Be sure to refresh scrub speed display when wheel moves but pointer does not
This commit is contained in:
parent
6500caf96c
commit
f24742acc0
@ -7545,7 +7545,7 @@ void TrackPanel::TimerUpdateScrubbing(double playPos)
|
||||
#endif
|
||||
wxT("%.2f");
|
||||
|
||||
mScrubSpeedText = wxString::Format(format, speed);
|
||||
mNextScrubSpeedText = wxString::Format(format, speed);
|
||||
|
||||
// Find the origin for drawing text
|
||||
wxCoord width, height;
|
||||
@ -7553,7 +7553,7 @@ void TrackPanel::TimerUpdateScrubbing(double playPos)
|
||||
wxClientDC dc(this);
|
||||
static const wxFont labelFont(24, wxSWISS, wxNORMAL, wxNORMAL);
|
||||
dc.SetFont(labelFont);
|
||||
dc.GetTextExtent(mScrubSpeedText, &width, &height);
|
||||
dc.GetTextExtent(mNextScrubSpeedText, &width, &height);
|
||||
}
|
||||
xx = std::max(0, std::min(panelWidth - width, xx - width / 2));
|
||||
|
||||
@ -7593,7 +7593,8 @@ std::pair<wxRect, bool> TrackPanel::GetScrubSpeedRectangle()
|
||||
|
||||
const bool outdated =
|
||||
(mLastScrubRect != mNextScrubRect) ||
|
||||
(!mLastScrubRect.IsEmpty() && !ShouldDrawScrubSpeed());
|
||||
(!mLastScrubRect.IsEmpty() && !ShouldDrawScrubSpeed()) ||
|
||||
(mLastScrubSpeedText != mNextScrubSpeedText);
|
||||
return std::make_pair(
|
||||
rect,
|
||||
outdated
|
||||
@ -7627,6 +7628,7 @@ void TrackPanel::DoDrawScrubSpeed(wxDC &dc)
|
||||
return;
|
||||
|
||||
mLastScrubRect = mNextScrubRect;
|
||||
mLastScrubSpeedText = mNextScrubSpeedText;
|
||||
const bool seeking = PollIsSeeking();
|
||||
if (// Draw for (non-scroll) scrub, sometimes, but never for seek
|
||||
(!seeking && mScrubSpeedDisplayCountdown > 0)
|
||||
@ -7652,7 +7654,7 @@ void TrackPanel::DoDrawScrubSpeed(wxDC &dc)
|
||||
#endif
|
||||
dc.SetTextForeground(clrNoScroll);
|
||||
|
||||
dc.DrawText(mScrubSpeedText, mLastScrubRect.GetX(), mLastScrubRect.GetY());
|
||||
dc.DrawText(mLastScrubSpeedText, mLastScrubRect.GetX(), mLastScrubRect.GetY());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -800,7 +800,7 @@ protected:
|
||||
bool mScrubSeekPress;
|
||||
|
||||
wxRect mLastScrubRect, mNextScrubRect;
|
||||
wxString mScrubSpeedText;
|
||||
wxString mLastScrubSpeedText, mNextScrubSpeedText;
|
||||
#endif
|
||||
|
||||
#ifdef EXPERIMENTAL_SCRUBBING_SMOOTH_SCROLL
|
||||
|
Loading…
x
Reference in New Issue
Block a user