From 5801716a78febf76c5b4e55b71b0bcce8b758b08 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 8 Jul 2025 17:59:57 -0600 Subject: [PATCH] fix MidiViewBackground keeping track of data note range --- gtk2_ardour/midi_view_background.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gtk2_ardour/midi_view_background.cc b/gtk2_ardour/midi_view_background.cc index 3fa946263e..9a62e8003a 100644 --- a/gtk2_ardour/midi_view_background.cc +++ b/gtk2_ardour/midi_view_background.cc @@ -375,14 +375,19 @@ MidiViewBackground::update_data_note_range (uint8_t min, uint8_t max) { bool dirty = false; - if (min < _data_note_min) { + /* Note: pitches can come and go, so both min and max could be moving + * up or down on any call. + */ + + if (min != _data_note_min) { _data_note_min = min; dirty = true; } - if (max > _data_note_max) { + if (max != _data_note_max) { _data_note_max = max; dirty = true; } + return dirty; }