From 85654707973efeb9af0b37b0e14fec90284989fd Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 16 Jan 2015 14:52:40 -0500 Subject: [PATCH] Fix hidden notes at trimmed region start. --- gtk2_ardour/midi_region_view.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc index b64c116b3f..ad7b618f5d 100644 --- a/gtk2_ardour/midi_region_view.cc +++ b/gtk2_ardour/midi_region_view.cc @@ -1657,8 +1657,12 @@ MidiRegionView::start_playing_midi_chord (vector > n bool MidiRegionView::note_in_region_range (const boost::shared_ptr note, bool& visible) const { + /* This is imprecise due to all the conversion conversion involved, so only + hide notes if they seem to start more than one tick before the start. */ + const framecnt_t tick_frames = Evoral::Beats::tick().to_ticks(trackview.session()->frame_rate()); const framepos_t note_start_frames = source_beats_to_region_frames (note->time()); - bool outside = (note_start_frames < 0) || (note_start_frames > _region->last_frame()); + const bool outside = ((note_start_frames <= -tick_frames) || + (note_start_frames > _region->last_frame())); visible = (note->note() >= midi_stream_view()->lowest_note()) && (note->note() <= midi_stream_view()->highest_note()); -- 2.30.2