1
0
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:
Paul Licameli
2019-06-08 08:25:16 -04:00
parent f87dfd43c1
commit d29d10d712
8 changed files with 26 additions and 60 deletions

View File

@@ -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;

View File

@@ -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)));