mirror of
https://github.com/cookiengineer/audacity
synced 2025-12-03 23:30:12 +01:00
Correct vertical ruler width recalculation for multiple sub-views...
... though not more than one is yet shown
This commit is contained in:
@@ -931,15 +931,20 @@ void TrackPanel::UpdateTrackVRuler(Track *t)
|
|||||||
|
|
||||||
auto iter = subViews.begin(), end = subViews.end(), next = iter;
|
auto iter = subViews.begin(), end = subViews.end(), next = iter;
|
||||||
auto yy = iter->first;
|
auto yy = iter->first;
|
||||||
|
wxSize vRulerSize{ 0, 0 };
|
||||||
for ( ; iter != end; iter = next ) {
|
for ( ; iter != end; iter = next ) {
|
||||||
++next;
|
++next;
|
||||||
auto nextY = ( next == end )
|
auto nextY = ( next == end )
|
||||||
? height
|
? height
|
||||||
: next->first;
|
: next->first;
|
||||||
rect.SetHeight( nextY - yy );
|
rect.SetHeight( nextY - yy );
|
||||||
|
// This causes ruler size in the track to be reassigned:
|
||||||
TrackVRulerControls::Get( *iter->second ).UpdateRuler( rect );
|
TrackVRulerControls::Get( *iter->second ).UpdateRuler( rect );
|
||||||
|
// But we want to know the maximum width and height over all sub-views:
|
||||||
|
vRulerSize.IncTo( t->vrulerSize );
|
||||||
yy = nextY;
|
yy = nextY;
|
||||||
}
|
}
|
||||||
|
t->vrulerSize = vRulerSize;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user