1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-18 09:00:07 +02:00

Clearer code for TimeTrack ruler

(Thanks to pi1024e)
This commit is contained in:
James Crook 2020-03-09 12:00:20 +00:00
parent 91bf05d18c
commit efc8f216b1

View File

@ -99,12 +99,8 @@ void DrawHorzRulerAndCurve
// Draw the Ruler
ruler.SetBounds(r.x, r.y, r.x + r.width - 1, r.y + r.height - 1);
ruler.SetRange(min, max);
ruler.SetFlip(false); // If we don't do this, the Ruler doesn't redraw itself when the envelope is modified.
// I have no idea why!
//
// LL: It's because the ruler only Invalidate()s when the NEW value is different
// than the current value.
ruler.SetFlip(TrackView::Get( track ).GetHeight() > 75 ? true : true); // MB: so why don't we just call Invalidate()? :)
ruler.SetFlip(true); // tick marks at top of track.
ruler.Invalidate(); // otherwise does not redraw.
ruler.SetTickColour( theTheme.Colour( clrTrackPanelText ));
ruler.Draw(dc, track.GetEnvelope());