13
0

midi regon view: fix logic error introduced when redisplay was split between model_changed and view_changed

This commit is contained in:
Paul Davis 2022-04-17 12:02:18 -06:00
parent f888d3d8ee
commit 3315a6588a

View File

@ -1170,21 +1170,28 @@ MidiRegionView::model_changed()
i = _events.erase (i);
} else {
bool visible = cne->item()->visible();
if ((sus = dynamic_cast<Note*>(cne))) {
bool visible;
if (note_in_region_range (cne->note(), visible)) {
if (visible) {
update_sustained (sus);
cne->item()->show ();
if ((sus = dynamic_cast<Note*>(cne))) {
update_sustained (sus);
} else if ((hit = dynamic_cast<Hit*>(cne))) {
update_hit (hit);
}
} else {
cne->item()->hide ();
}
} else if ((hit = dynamic_cast<Hit*>(cne))) {
if (visible) {
update_hit (hit);
}
} else {
cne->item()->hide ();
}
++i;
}
}
@ -1266,13 +1273,25 @@ MidiRegionView::view_changed()
for (Events::iterator i = _events.begin(); i != _events.end(); ) {
NoteBase* cne = i->second;
bool visible;
if (cne->item()->visible()) {
if ((sus = dynamic_cast<Note*>(cne))) {
update_sustained (sus);
if (note_in_region_range (cne->note(), visible)) {
if (visible) {
cne->item()->show ();
if ((sus = dynamic_cast<Note*>(cne))) {
update_sustained (sus);
} else if ((hit = dynamic_cast<Hit*>(cne))) {
update_hit (hit);
}
} else {
cne->item()->hide ();
}
} else if ((hit = dynamic_cast<Hit*>(cne))) {
update_hit (hit);
} else {
cne->item()->hide ();
}
++i;