mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-17 09:07:41 +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
|
// Calculate the horizontal position of the indicator
|
||||||
pos = gAudioIO->GetStreamTime();
|
pos = gAudioIO->GetStreamTime();
|
||||||
|
|
||||||
|
|
||||||
#ifdef EXPERIMENTAL_SCRUBBING_SMOOTH_SCROLL
|
#ifdef EXPERIMENTAL_SCRUBBING_SMOOTH_SCROLL
|
||||||
if (mSmoothScrollingScrub) {
|
if (mSmoothScrollingScrub) {
|
||||||
// Pan the view, so that we center the play indicator.
|
// Pan the view, so that we center the play indicator.
|
||||||
const double duration = GetScreenEndTime() - mViewInfo->h;
|
const int posX = mViewInfo->TimeToPosition(pos);
|
||||||
mViewInfo->h = pos - duration / 2.0;
|
int width;
|
||||||
|
GetTracksUsableArea(&width, NULL);
|
||||||
|
const int deltaX = posX - width / 2;
|
||||||
|
mViewInfo->h =
|
||||||
|
mViewInfo->OffsetTimeByPixels(mViewInfo->h, deltaX, true);
|
||||||
if (!mScrollBeyondZero)
|
if (!mScrollBeyondZero)
|
||||||
// Can't scroll too far left
|
// Can't scroll too far left
|
||||||
mViewInfo->h = std::max(0.0, mViewInfo->h);
|
mViewInfo->h = std::max(0.0, mViewInfo->h);
|
||||||
|
@ -62,9 +62,9 @@ public:
|
|||||||
, bool ignoreFisheye = false
|
, bool ignoreFisheye = false
|
||||||
) const;
|
) 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;
|
bool ZoomInAvailable() const;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user