mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-14 17:14:07 +01:00
GetTracksUsableArea() out of TrackPanel
This commit is contained in:
@@ -150,8 +150,7 @@ void PlayIndicatorOverlay::OnTimer(wxCommandEvent &event)
|
||||
|
||||
auto &trackPanel = TrackPanel::Get( *mProject );
|
||||
const auto &viewInfo = ViewInfo::Get( *mProject );
|
||||
int width;
|
||||
trackPanel.GetTracksUsableArea(&width, nullptr);
|
||||
auto width = viewInfo.GetTracksUsableWidth();
|
||||
|
||||
if (!ProjectAudioIO::Get( *mProject ).IsAudioActive()) {
|
||||
mNewIndicatorX = -1;
|
||||
|
||||
@@ -611,8 +611,7 @@ void Scrubber::ContinueScrubbingPoll()
|
||||
// toward the mouse position, then move the target time to a more
|
||||
// extreme position to avoid catching-up and halting before the
|
||||
// screen scrolls.
|
||||
int width;
|
||||
trackPanel.GetTracksUsableArea(&width, NULL);
|
||||
auto width = viewInfo.GetTracksUsableWidth();
|
||||
auto delta = xx - origin;
|
||||
if (delta < 0)
|
||||
delta -= width;
|
||||
@@ -1077,8 +1076,7 @@ void Scrubber::DoScrub(bool seek)
|
||||
wxCoord xx = tp.ScreenToClient(::wxGetMouseState().GetPosition()).x;
|
||||
|
||||
// Limit x
|
||||
int width;
|
||||
tp.GetTracksUsableArea(&width, nullptr);
|
||||
auto width = viewInfo.GetTracksUsableWidth();
|
||||
const auto offset = viewInfo.GetLeftOffset();
|
||||
xx = (std::max(offset, std::min(offset + width - 1, xx)));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user