From a54d105107ff48fd36246f3d6d36f4e7bd685d8e Mon Sep 17 00:00:00 2001 From: nick_m Date: Sun, 9 Oct 2016 03:24:14 +1100 Subject: Use double comparison in MidiRegionView::note_in_region_range(). --- gtk2_ardour/midi_region_view.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gtk2_ardour/midi_region_view.cc') 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 note, bool& visible) const { const boost::shared_ptr 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()); -- cgit v1.2.3