From 9243dcf9619ca9b106271b41d4400c326f69f42a Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 25 Nov 2024 18:30:01 -0700 Subject: [PATCH] draw clip rect correctly after it is reset\n --- gtk2_ardour/midi_view.cc | 13 +++++++++++-- gtk2_ardour/midi_view.h | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/gtk2_ardour/midi_view.cc b/gtk2_ardour/midi_view.cc index 80feb8165f..e55bd2f509 100644 --- a/gtk2_ardour/midi_view.cc +++ b/gtk2_ardour/midi_view.cc @@ -304,6 +304,7 @@ MidiView::region_going_away () _midi_region.reset (); _model.reset (); connections_requiring_model.drop_connections(); + region_connections.drop_connections (); } void @@ -316,7 +317,8 @@ MidiView::set_region (std::shared_ptr mr) return; } - _midi_region->DropReferences.connect (region_going_away_connection, invalidator (*this), std::bind (&MidiView::region_going_away, this), gui_context()); + _midi_region->DropReferences.connect (region_connections, invalidator (*this), std::bind (&MidiView::region_going_away, this), gui_context()); + _midi_region->PropertyChanged.connect (region_connections, invalidator (*this), std::bind (&MidiView::region_resized, this, _1), gui_context()); set_model (_midi_region->midi_source (0)->model()); } @@ -1597,7 +1599,14 @@ MidiView::~MidiView () void MidiView::region_resized (const PropertyChange& what_changed) { - // XXX RegionView::region_resized(what_changed); // calls RegionView::set_duration() + PropertyChange interests; + interests.add (ARDOUR::Properties::start); + interests.add (ARDOUR::Properties::length); + + if (what_changed.contains (interests)) { + size_start_rect (); + size_end_rect (); + } } void diff --git a/gtk2_ardour/midi_view.h b/gtk2_ardour/midi_view.h index fea97da2e4..072a8b3da1 100644 --- a/gtk2_ardour/midi_view.h +++ b/gtk2_ardour/midi_view.h @@ -452,7 +452,7 @@ class MidiView : public virtual sigc::trackable, public LineMerger PBD::ScopedConnectionList connections_requiring_model; PBD::ScopedConnection track_going_away_connection; - PBD::ScopedConnection region_going_away_connection; + PBD::ScopedConnectionList region_connections; void track_going_away (); void region_going_away ();