summaryrefslogtreecommitdiff
path: root/gtk2_ardour/midi_region_view.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-07-22 01:45:52 +0000
committerCarl Hetherington <carl@carlh.net>2010-07-22 01:45:52 +0000
commit94918c2a63c62d4c0483bac981c0596363634c04 (patch)
tree7291a5820cfa2585644c0f7a9cee7e0c1242d631 /gtk2_ardour/midi_region_view.cc
parentcb80dbd927bfe151b4ed86bd2a6474b61dae1c67 (diff)
Trim note display to not overlap the end of its region. Should fix #3202 and #2143.
git-svn-id: svn://localhost/ardour2/branches/3.0@7466 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/midi_region_view.cc')
-rw-r--r--gtk2_ardour/midi_region_view.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc
index 25254e6bc2..9f67dc89ba 100644
--- a/gtk2_ardour/midi_region_view.cc
+++ b/gtk2_ardour/midi_region_view.cc
@@ -1335,7 +1335,9 @@ MidiRegionView::update_note (CanvasNote* ev)
boost::shared_ptr<NoteType> note = ev->note();
const nframes64_t note_start_frames = beats_to_frames(note->time());
- const nframes64_t note_end_frames = beats_to_frames(note->end_time());
+
+ /* trim note display to not overlap the end of its region */
+ const nframes64_t note_end_frames = min (beats_to_frames (note->end_time()), _region->start() + _region->length());
const double x = trackview.editor().frame_to_pixel(note_start_frames - _region->start());
const double y1 = midi_stream_view()->note_to_y(note->note());