Skip to content

Commit

Permalink
Fix crash on drawing line on the end of a graph (LMMS#5471)
Browse files Browse the repository at this point in the history
This bug was introduced in 9e03399.
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.
  • Loading branch information
PhysSong authored Apr 28, 2020
1 parent 4e9bc4a commit 84b9b90
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/gui/widgets/Graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down

0 comments on commit 84b9b90

Please sign in to comment.