From baa855d3a0740908cdc683850a018cd19e83bf5c Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 4 Jun 2025 20:41:03 -0600 Subject: [PATCH] fix an error with piano roll header display for a new track --- gtk2_ardour/midi_view_background.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gtk2_ardour/midi_view_background.cc b/gtk2_ardour/midi_view_background.cc index 1a838a46ed..119f45ffb0 100644 --- a/gtk2_ardour/midi_view_background.cc +++ b/gtk2_ardour/midi_view_background.cc @@ -301,12 +301,12 @@ MidiViewBackground::apply_note_range (uint8_t lowest, uint8_t highest, bool to_c int const max_note_height = std::max (mnh, mnh * uiscale); int const range = _highest_note - _lowest_note; int nh = contents_height() / range; - int additional_notes; + int additional_notes = 0; if (nh > max_note_height) { int const available_note_range = contents_height() / max_note_height; additional_notes = available_note_range - range; - } else { + } else if (note_range_set) { additional_notes = (contents_height() - (nh * range)) / nh; }