mirror of
https://github.com/cookiengineer/audacity
synced 2026-01-26 15:03:47 +01:00
Stubs needed to eliminate remaining direct uses of ViewInfo::zoom ...
... and anticipate a problems fisheye will introduce with time ruler display and horizontal scrolling past zero. Will be used in waveform and spectrogram drawing, and in hit-test for sample editing. Those things will no longer make the assumption of uniform zoom level across the width of the screen, though that does remain true without the rest of the fisheye project.
This commit is contained in:
@@ -37,7 +37,8 @@ ZoomInfo::~ZoomInfo()
|
||||
/// the track as an additional parameter.
|
||||
double ZoomInfo::PositionToTime(wxInt64 position,
|
||||
wxInt64 origin
|
||||
) const
|
||||
, bool // ignoreFisheye
|
||||
) const
|
||||
{
|
||||
return h + (position - origin) / zoom;
|
||||
}
|
||||
@@ -46,7 +47,8 @@ double ZoomInfo::PositionToTime(wxInt64 position,
|
||||
/// STM: Converts a project time to screen x position.
|
||||
wxInt64 ZoomInfo::TimeToPosition(double projectTime,
|
||||
wxInt64 origin
|
||||
) const
|
||||
, bool // ignoreFisheye
|
||||
) const
|
||||
{
|
||||
return floor(0.5 +
|
||||
zoom * (projectTime - h) + origin
|
||||
@@ -73,6 +75,23 @@ void ZoomInfo::ZoomBy(double multiplier)
|
||||
SetZoom(zoom * multiplier);
|
||||
}
|
||||
|
||||
void ZoomInfo::FindIntervals
|
||||
(double /*rate*/, Intervals &results, wxInt64 origin) const
|
||||
{
|
||||
results.clear();
|
||||
results.reserve(2);
|
||||
|
||||
const wxInt64 rightmost(origin + (0.5 + screen * zoom));
|
||||
wxASSERT(origin <= rightmost);
|
||||
{
|
||||
results.push_back(Interval(origin, zoom, false));
|
||||
}
|
||||
|
||||
if (origin < rightmost)
|
||||
results.push_back(Interval(rightmost, 0, false));
|
||||
wxASSERT(!results.empty() && results[0].position == origin);
|
||||
}
|
||||
|
||||
ViewInfo::ViewInfo(double start, double screenDuration, double pixelsPerSecond)
|
||||
: ZoomInfo(start, screenDuration, pixelsPerSecond)
|
||||
, selectedRegion()
|
||||
|
||||
Reference in New Issue
Block a user