mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-27 15:38:19 +01:00
reduce jumping note range in MIDI displays when adding notes
This commit is contained in:
parent
b93a61998d
commit
f2eea8b7ce
2 changed files with 9 additions and 7 deletions
|
|
@ -207,7 +207,9 @@ MidiStreamView::display_region (MidiRegionView* region_view, bool)
|
|||
return;
|
||||
}
|
||||
|
||||
_range_dirty = update_data_note_range (source->model()->lowest_note(), source->model()->highest_note());
|
||||
if (!source->model()->empty()) {
|
||||
_range_dirty = update_data_note_range (source->model()->lowest_note(), source->model()->highest_note());
|
||||
}
|
||||
|
||||
// Display region contents
|
||||
region_view->display_model (source->model());
|
||||
|
|
|
|||
|
|
@ -1165,18 +1165,18 @@ MidiView::model_changed()
|
|||
if (!notes.empty()) {
|
||||
low_note = _model->lowest_note ();
|
||||
hi_note = _model->highest_note ();
|
||||
|
||||
_midi_context.update_data_note_range (low_note, hi_note);
|
||||
|
||||
if (_midi_context.visibility_range_style() == MidiViewBackground::ContentsRange) {
|
||||
maybe_set_note_range (low_note, hi_note);
|
||||
}
|
||||
} else {
|
||||
/* Pick a reasonable default range if the model is mepty */
|
||||
low_note = UIConfiguration::instance().get_default_lower_midi_note();
|
||||
hi_note = UIConfiguration::instance().get_default_upper_midi_note();
|
||||
}
|
||||
|
||||
_midi_context.update_data_note_range (low_note, hi_note);
|
||||
|
||||
if (_midi_context.visibility_range_style() == MidiViewBackground::ContentsRange) {
|
||||
maybe_set_note_range (low_note, hi_note);
|
||||
}
|
||||
|
||||
for (auto & note : notes) {
|
||||
|
||||
bool visible;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue