hide patch changes if they are too wide for the region at a given zoom level
[ardour.git] / gtk2_ardour / midi_region_view.cc
index 94a07e4fdd34fd7c1a5477fe056a83de7d6cb36f..5d8bca9d776aeedec877445318fb91482ad3de81 100644 (file)
@@ -1347,6 +1347,14 @@ MidiRegionView::reset_width_dependent_items (double pixel_width)
                redisplay_model();
        }
 
+       for (PatchChanges::iterator x = _patch_changes.begin(); x != _patch_changes.end(); ++x) {
+               if ((*x)->width() >= _pixel_width) {
+                       (*x)->hide();
+               } else {
+                       (*x)->show();
+               }
+       }
+
        move_step_edit_cursor (_step_edit_cursor_position);
        set_step_edit_cursor_width (_step_edit_cursor_width);
 }