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
|
#endif
|
||||||
wxT("%.2f");
|
wxT("%.2f");
|
||||||
|
|
||||||
mScrubSpeedText = wxString::Format(format, speed);
|
mNextScrubSpeedText = wxString::Format(format, speed);
|
||||||
|
|
||||||
// Find the origin for drawing text
|
// Find the origin for drawing text
|
||||||
wxCoord width, height;
|
wxCoord width, height;
|
||||||
@ -7553,7 +7553,7 @@ void TrackPanel::TimerUpdateScrubbing(double playPos)
|
|||||||
wxClientDC dc(this);
|
wxClientDC dc(this);
|
||||||
static const wxFont labelFont(24, wxSWISS, wxNORMAL, wxNORMAL);
|
static const wxFont labelFont(24, wxSWISS, wxNORMAL, wxNORMAL);
|
||||||
dc.SetFont(labelFont);
|
dc.SetFont(labelFont);
|
||||||
dc.GetTextExtent(mScrubSpeedText, &width, &height);
|
dc.GetTextExtent(mNextScrubSpeedText, &width, &height);
|
||||||
}
|
}
|
||||||
xx = std::max(0, std::min(panelWidth - width, xx - width / 2));
|
xx = std::max(0, std::min(panelWidth - width, xx - width / 2));
|
||||||
|
|
||||||
@ -7593,7 +7593,8 @@ std::pair<wxRect, bool> TrackPanel::GetScrubSpeedRectangle()
|
|||||||
|
|
||||||
const bool outdated =
|
const bool outdated =
|
||||||
(mLastScrubRect != mNextScrubRect) ||
|
(mLastScrubRect != mNextScrubRect) ||
|
||||||
(!mLastScrubRect.IsEmpty() && !ShouldDrawScrubSpeed());
|
(!mLastScrubRect.IsEmpty() && !ShouldDrawScrubSpeed()) ||
|
||||||
|
(mLastScrubSpeedText != mNextScrubSpeedText);
|
||||||
return std::make_pair(
|
return std::make_pair(
|
||||||
rect,
|
rect,
|
||||||
outdated
|
outdated
|
||||||
@ -7627,6 +7628,7 @@ void TrackPanel::DoDrawScrubSpeed(wxDC &dc)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
mLastScrubRect = mNextScrubRect;
|
mLastScrubRect = mNextScrubRect;
|
||||||
|
mLastScrubSpeedText = mNextScrubSpeedText;
|
||||||
const bool seeking = PollIsSeeking();
|
const bool seeking = PollIsSeeking();
|
||||||
if (// Draw for (non-scroll) scrub, sometimes, but never for seek
|
if (// Draw for (non-scroll) scrub, sometimes, but never for seek
|
||||||
(!seeking && mScrubSpeedDisplayCountdown > 0)
|
(!seeking && mScrubSpeedDisplayCountdown > 0)
|
||||||
@ -7652,7 +7654,7 @@ void TrackPanel::DoDrawScrubSpeed(wxDC &dc)
|
|||||||
#endif
|
#endif
|
||||||
dc.SetTextForeground(clrNoScroll);
|
dc.SetTextForeground(clrNoScroll);
|
||||||
|
|
||||||
dc.DrawText(mScrubSpeedText, mLastScrubRect.GetX(), mLastScrubRect.GetY());
|
dc.DrawText(mLastScrubSpeedText, mLastScrubRect.GetX(), mLastScrubRect.GetY());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -800,7 +800,7 @@ protected:
|
|||||||
bool mScrubSeekPress;
|
bool mScrubSeekPress;
|
||||||
|
|
||||||
wxRect mLastScrubRect, mNextScrubRect;
|
wxRect mLastScrubRect, mNextScrubRect;
|
||||||
wxString mScrubSpeedText;
|
wxString mLastScrubSpeedText, mNextScrubSpeedText;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef EXPERIMENTAL_SCRUBBING_SMOOTH_SCROLL
|
#ifdef EXPERIMENTAL_SCRUBBING_SMOOTH_SCROLL
|
||||||
|
Loading…
x
Reference in New Issue
Block a user