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

Fix ghost image on track panel

Thanks to David for tracking down the cause, the ghost has
been banished.
This commit is contained in:
Leland Lucius 2015-08-19 15:29:54 -05:00
parent b9bc4521fe
commit b19ed258e9
2 changed files with 9 additions and 10 deletions

View File

@ -8426,23 +8426,21 @@ void TrackPanel::SeekLeftOrRight
// negative to move backward.
double TrackPanel::GridMove(double t, int minPix)
{
NumericTextCtrl ttc(NumericConverter::TIME, this, wxID_ANY, wxT(""), 0.0, GetProject()->GetRate());
ttc.SetFormatName(GetProject()->GetSelectionFormat());
ttc.SetValue(t);
NumericConverter nc(NumericConverter::TIME, GetProject()->GetSelectionFormat(), t, GetProject()->GetRate());
// Try incrementing/decrementing the value; if we've moved far enough we're
// done
double result;
minPix >= 0 ? ttc.Increment() : ttc.Decrement();
result = ttc.GetValue();
minPix >= 0 ? nc.Increment() : nc.Decrement();
result = nc.GetValue();
if (std::abs(mViewInfo->TimeToPosition(result) - mViewInfo->TimeToPosition(t))
>= abs(minPix))
return result;
// Otherwise, move minPix pixels, then snap to the time.
result = mViewInfo->OffsetTimeByPixels(t, minPix);
ttc.SetValue(result);
result = ttc.GetValue();
nc.SetValue(result);
result = nc.GetValue();
return result;
}

View File

@ -1836,7 +1836,8 @@ void AdornedRulerPanel::OnErase(wxEraseEvent & WXUNUSED(evt))
void AdornedRulerPanel::OnPaint(wxPaintEvent & WXUNUSED(evt))
{
wxBufferedPaintDC dc(this);
// wxBufferedPaintDC dc(this);
wxPaintDC dc(this);
DoDrawBorder(&dc);
@ -1845,6 +1846,8 @@ void AdornedRulerPanel::OnPaint(wxPaintEvent & WXUNUSED(evt))
DoDrawSelection(&dc);
}
DoDrawMarks(&dc, true);
if (mIndType >= 0)
{
DoDrawIndicator(&dc);
@ -1855,8 +1858,6 @@ void AdornedRulerPanel::OnPaint(wxPaintEvent & WXUNUSED(evt))
DrawQuickPlayIndicator(&dc, false);
}
DoDrawMarks(&dc, true);
if (mViewInfo->selectedRegion.isPoint())
{
DoDrawCursor(&dc);