From efc8f216b1ca416c69689e706e036bea2a55a77c Mon Sep 17 00:00:00 2001 From: James Crook Date: Mon, 9 Mar 2020 12:00:20 +0000 Subject: [PATCH] Clearer code for TimeTrack ruler (Thanks to pi1024e) --- src/tracks/timetrack/ui/TimeTrackView.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/tracks/timetrack/ui/TimeTrackView.cpp b/src/tracks/timetrack/ui/TimeTrackView.cpp index bf4f98870..7a4e52f66 100644 --- a/src/tracks/timetrack/ui/TimeTrackView.cpp +++ b/src/tracks/timetrack/ui/TimeTrackView.cpp @@ -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());