Fix non visibility of previously-visible MIDI automation
[ardour.git] / gtk2_ardour / editor_routes.cc
index f58ea47868fd54f52fbfcf80c51ce97cce38d257..714c5faad92a2da2363ef3507259fb47fc81006a 100644 (file)
@@ -474,10 +474,11 @@ EditorRoutes::redisplay ()
                if (visible) {
                        position += tv->show_at (position, n, &_editor->edit_controls_vbox);
                        tv->clip_to_viewport ();
-                       n++;
                } else {
                        tv->hide ();
                }
+
+               n++;
        }
 
        /* whenever we go idle, update the track view list to reflect the new order.
@@ -782,6 +783,8 @@ EditorRoutes::sync_order_keys (string const & src)
                        co.push_back (i->second);
                }
 
+               assert (co.size() == _model->children().size ());
+
                _model->reorder (co);
                _redisplay_does_not_reset_order_keys = false;
        }