mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-17 08:30:06 +02:00
Lost the change when I reverted
This commit is contained in:
parent
e416b1f373
commit
cca23724c2
@ -8426,23 +8426,21 @@ void TrackPanel::SeekLeftOrRight
|
|||||||
// negative to move backward.
|
// negative to move backward.
|
||||||
double TrackPanel::GridMove(double t, int minPix)
|
double TrackPanel::GridMove(double t, int minPix)
|
||||||
{
|
{
|
||||||
NumericTextCtrl ttc(NumericConverter::TIME, this, wxID_ANY, wxT(""), 0.0, GetProject()->GetRate());
|
NumericConverter nc(NumericConverter::TIME, GetProject()->GetSelectionFormat(), t, GetProject()->GetRate());
|
||||||
ttc.SetFormatName(GetProject()->GetSelectionFormat());
|
|
||||||
ttc.SetValue(t);
|
|
||||||
|
|
||||||
// Try incrementing/decrementing the value; if we've moved far enough we're
|
// Try incrementing/decrementing the value; if we've moved far enough we're
|
||||||
// done
|
// done
|
||||||
double result;
|
double result;
|
||||||
minPix >= 0 ? ttc.Increment() : ttc.Decrement();
|
minPix >= 0 ? nc.Increment() : nc.Decrement();
|
||||||
result = ttc.GetValue();
|
result = nc.GetValue();
|
||||||
if (std::abs(mViewInfo->TimeToPosition(result) - mViewInfo->TimeToPosition(t))
|
if (std::abs(mViewInfo->TimeToPosition(result) - mViewInfo->TimeToPosition(t))
|
||||||
>= abs(minPix))
|
>= abs(minPix))
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
// Otherwise, move minPix pixels, then snap to the time.
|
// Otherwise, move minPix pixels, then snap to the time.
|
||||||
result = mViewInfo->OffsetTimeByPixels(t, minPix);
|
result = mViewInfo->OffsetTimeByPixels(t, minPix);
|
||||||
ttc.SetValue(result);
|
nc.SetValue(result);
|
||||||
result = ttc.GetValue();
|
result = nc.GetValue();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user