Fix crash on drawing line on the end of a graph (#5471)

This bug was introduced in dff76b2e83.
The function changes [sample_end, sample_begin), but emits the signal
as if [sample_end, sample_begin] has been changed. That bug made
Multitap Echo crash when tweaking the cutoff of the 32nd stage.

This commit fixes the issue by emitting sampleChanged with sample_end - 1.
This commit is contained in:
Hyunjin Song
2020-04-28 14:39:39 +09:00
committed by GitHub
parent 9efb6f9a8e
commit e199f72686

View File

@@ -235,8 +235,9 @@ void Graph::drawLineAt( int _x, int _y, int _lastx )
model()->drawSampleAt( sample_begin + i , val_begin + ((i ) * ystep));
}
model()->samplesChanged( sample_begin, sample_end );
// We've changed [sample_end, sample_begin)
// However, samplesChanged expects two end points
model()->samplesChanged(sample_begin, sample_end - 1);
}
void Graph::changeSampleAt( int _x, int _y )