1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-26 23:33:49 +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

@@ -53,7 +53,6 @@ AudacityProject::AttachedWindows::RegisteredFactory sLyricsWindowKey{
double GetZoomOfSelection( const AudacityProject &project )
{
auto &viewInfo = ViewInfo::Get( project );
auto &trackPanel = TrackPanel::Get( project );
auto &window = ProjectWindow::Get( project );
const double lowerBound =
@@ -74,8 +73,7 @@ double GetZoomOfSelection( const AudacityProject &project )
// Fixes might have resulted from commits
// 1b8f44d0537d987c59653b11ed75a842b48896ea and
// e7c7bb84a966c3b3cc4b3a9717d5f247f25e7296
int width;
trackPanel.GetTracksUsableArea(&width, NULL);
auto width = viewInfo.GetTracksUsableWidth();
return (width - 1) / denom;
}
@@ -149,7 +147,7 @@ double GetZoomOfPreset( const AudacityProject &project, int preset )
namespace {
void DoZoomFitV(AudacityProject &project)
{
auto &trackPanel = TrackPanel::Get( project );
auto &viewInfo = ViewInfo::Get( project );
auto &tracks = TrackList::Get( project );
// Only nonminimized audio tracks will be resized
@@ -161,8 +159,7 @@ void DoZoomFitV(AudacityProject &project)
return;
// Find total height to apportion
int height;
trackPanel.GetTracksUsableArea(NULL, &height);
auto height = viewInfo.GetHeight();
height -= 28;
// The height of minimized and non-audio tracks cannot be apportioned