From 058c729ea544e326938b9473e7b9a5cd5ecc6ab5 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Sun, 8 Aug 2021 10:32:25 -0400 Subject: [PATCH] TrackInfo doesn't use the kTopMargin or kBottomMargin constants... ... It only needs their sum, which it will assume is the constant amount of padding always between tracks (not channels of a track). --- src/TrackInfo.cpp | 4 ++-- src/ViewInfo.h | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/TrackInfo.cpp b/src/TrackInfo.cpp index ed220a510..cc819e43a 100644 --- a/src/TrackInfo.cpp +++ b/src/TrackInfo.cpp @@ -201,7 +201,7 @@ unsigned TrackInfo::MinimumTrackHeight() height += commonTrackTCPBottomLines.front().height; // + 1 prevents the top item from disappearing for want of enough space, // according to the rules in HideTopItem. - return height + kTopMargin + kBottomMargin + 1; + return height + kVerticalPadding + 1; } bool TrackInfo::HideTopItem( const wxRect &rect, const wxRect &subRect, @@ -565,7 +565,7 @@ void TrackInfo::SetTrackInfoFont(wxDC * dc) unsigned TrackInfo::DefaultTrackHeight( const TCPLines &topLines ) { int needed = - kTopMargin + kBottomMargin + + kVerticalPadding + totalTCPLines( topLines, true ) + totalTCPLines( commonTrackTCPBottomLines, false ) + 1; return (unsigned) std::max( needed, (int) TrackView::DefaultHeight ); diff --git a/src/ViewInfo.h b/src/ViewInfo.h index 62264246e..19537ec21 100644 --- a/src/ViewInfo.h +++ b/src/ViewInfo.h @@ -99,8 +99,9 @@ private: }; // See big pictorial comment in TrackPanel.cpp for explanation of these numbers +//! constants related to y coordinates in the track panel enum : int { - // constants related to y coordinates in the track panel + kVerticalPadding = 7, /*!< Width of padding below each channel group */ kAffordancesAreaHeight = 20, kTopInset = 4, kTopMargin = kTopInset + kBorderThickness, @@ -108,6 +109,8 @@ enum : int { kSeparatorThickness = kBottomMargin + kTopMargin, }; +static_assert( kVerticalPadding == kTopMargin + kBottomMargin ); + enum : int { kTrackInfoBtnSize = 18, // widely used dimension, usually height kTrackInfoSliderHeight = 25,