mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-03 17:19:43 +02:00
Correct the one-pixel wobble in scroll-scrubbing play indicator...
... that is, the green line, though the triangle in the ruler still jumps sometimes.
This commit is contained in:
parent
a35669a562
commit
67c794891d
@ -1214,11 +1214,16 @@ void TrackPanel::TimerUpdateIndicator()
|
||||
// Calculate the horizontal position of the indicator
|
||||
pos = gAudioIO->GetStreamTime();
|
||||
|
||||
|
||||
#ifdef EXPERIMENTAL_SCRUBBING_SMOOTH_SCROLL
|
||||
if (mSmoothScrollingScrub) {
|
||||
// Pan the view, so that we center the play indicator.
|
||||
const double duration = GetScreenEndTime() - mViewInfo->h;
|
||||
mViewInfo->h = pos - duration / 2.0;
|
||||
const int posX = mViewInfo->TimeToPosition(pos);
|
||||
int width;
|
||||
GetTracksUsableArea(&width, NULL);
|
||||
const int deltaX = posX - width / 2;
|
||||
mViewInfo->h =
|
||||
mViewInfo->OffsetTimeByPixels(mViewInfo->h, deltaX, true);
|
||||
if (!mScrollBeyondZero)
|
||||
// Can't scroll too far left
|
||||
mViewInfo->h = std::max(0.0, mViewInfo->h);
|
||||
|
@ -62,9 +62,9 @@ public:
|
||||
, bool ignoreFisheye = false
|
||||
) const;
|
||||
|
||||
double OffsetTimeByPixels(double time, wxInt64 offset) const
|
||||
double OffsetTimeByPixels(double time, wxInt64 offset, bool ignoreFisheye = false) const
|
||||
{
|
||||
return PositionToTime(offset + TimeToPosition(time));
|
||||
return PositionToTime(offset + TimeToPosition(time, ignoreFisheye), ignoreFisheye);
|
||||
}
|
||||
|
||||
bool ZoomInAvailable() const;
|
||||
|
Loading…
x
Reference in New Issue
Block a user