prevent MIDI note starts being drawn earlier than their region start
authorPaul Davis <paul@linuxaudiosystems.com>
Wed, 8 Jan 2020 17:21:55 +0000 (10:21 -0700)
committerPaul Davis <paul@linuxaudiosystems.com>
Wed, 8 Jan 2020 17:22:08 +0000 (10:22 -0700)
gtk2_ardour/midi_region_view.cc

index 01fcfab51e8ad4f04354090b65f26a593ec2ddf5..4612b7fd97bd8c44481a654cf6e2b3460f912f70 100644 (file)
@@ -1756,12 +1756,11 @@ MidiRegionView::update_sustained (Note* ev, bool update_ghost_regions)
        const double session_source_start = _region->quarter_note() - mr->start_beats();
        const samplepos_t note_start_samples = map.sample_at_quarter_note (note->time().to_double() + session_source_start) - _region->position();
 
-       const double x0 = trackview.editor().sample_to_pixel (note_start_samples);
+       const double x0 = max (0.,trackview.editor().sample_to_pixel (note_start_samples));
        double x1;
        const double y0 = 1 + floor(note_to_y(note->note()));
        double y1;
 
-       /* trim note display to not overlap the end of its region */
        if (note->length().to_double() > 0.0) {
                double note_end_time = note->end_time().to_double();