diff options
author | nick_m <mainsbridge@gmail.com> | 2016-10-09 03:24:14 +1100 |
---|---|---|
committer | nick_m <mainsbridge@gmail.com> | 2016-10-09 03:24:14 +1100 |
commit | a54d105107ff48fd36246f3d6d36f4e7bd685d8e (patch) | |
tree | 6678cf4b38e21ab82afdbc71c8b2b909020a37f7 | |
parent | d17336c4a8e94d269d58616ad52e232a3af4dd74 (diff) |
Use double comparison in MidiRegionView::note_in_region_range().
-rw-r--r-- | gtk2_ardour/midi_region_view.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc index a2aa46f3ff..f1404c936c 100644 --- a/gtk2_ardour/midi_region_view.cc +++ b/gtk2_ardour/midi_region_view.cc @@ -1671,8 +1671,10 @@ bool MidiRegionView::note_in_region_range (const boost::shared_ptr<NoteType> note, bool& visible) const { const boost::shared_ptr<ARDOUR::MidiRegion> midi_reg = midi_region(); - const bool outside = (note->time() < midi_reg->start_beats() || - note->time() > midi_reg->start_beats() + midi_reg->length_beats()); + + /* must compare double explicitly as Beats::operator< rounds to ppqn */ + const bool outside = (note->time().to_double() < midi_reg->start_beats().to_double() || + note->time().to_double() > (midi_reg->start_beats() + midi_reg->length_beats()).to_double()); visible = (note->note() >= midi_stream_view()->lowest_note()) && (note->note() <= midi_stream_view()->highest_note()); |