1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-09-17 16:50:26 +02:00

Fix off-by-one width in TrackPanel::GetTracksUsableArea()

This commit is contained in:
Paul Licameli 2015-08-21 11:49:49 -04:00
parent 4b028995cb
commit e7c7bb84a9
2 changed files with 2 additions and 1 deletions

View File

@ -1074,7 +1074,7 @@ void TrackPanel::SelectTrackLength(Track *t)
void TrackPanel::GetTracksUsableArea(int *width, int *height) const
{
GetSize(width, height);
*width -= GetLabelWidth();
*width -= GetLeftOffset();
*width -= kRightMargin;
*width = std::max(0, *width);
}

View File

@ -165,6 +165,7 @@ class AUDACITY_DLL_API TrackPanel:public wxPanel {
virtual int GetLeftOffset() const { return GetLabelWidth() + 1;}
// Width and height, relative to upper left corner at (GetLeftOffset(), 0)
virtual void GetTracksUsableArea(int *width, int *height) const;
virtual void SelectNone();