summaryrefslogtreecommitdiff
path: root/gtk2_ardour/midi_region_view.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2011-02-28 03:59:41 +0000
committerCarl Hetherington <carl@carlh.net>2011-02-28 03:59:41 +0000
commit5c2c0b3f758105f384a56b0ee3b6010ef32c4f17 (patch)
treedd606c74499275b0fd076c41ccc7e486b76fda6e /gtk2_ardour/midi_region_view.cc
parentee92df2a25015d383fedebf6900ac61b3f0630f4 (diff)
Make sure notes fit in the allocated height of a newly-created ghost region.
git-svn-id: svn://localhost/ardour2/branches/3.0@8983 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/midi_region_view.cc')
-rw-r--r--gtk2_ardour/midi_region_view.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc
index 10d869945a..e76433bcae 100644
--- a/gtk2_ardour/midi_region_view.cc
+++ b/gtk2_ardour/midi_region_view.cc
@@ -1324,16 +1324,16 @@ MidiRegionView::add_ghost (TimeAxisView& tv)
ghost = new MidiGhostRegion (tv, trackview, unit_position);
}
- ghost->set_height ();
- ghost->set_duration (_region->length() / samples_per_unit);
- ghosts.push_back (ghost);
-
for (Events::iterator i = _events.begin(); i != _events.end(); ++i) {
if ((note = dynamic_cast<CanvasNote*>(*i)) != 0) {
ghost->add_note(note);
}
}
+ ghost->set_height ();
+ ghost->set_duration (_region->length() / samples_per_unit);
+ ghosts.push_back (ghost);
+
GhostRegion::CatchDeletion.connect (*this, invalidator (*this), ui_bind (&RegionView::remove_ghost, this, _1), gui_context());
return ghost;