MidiTime/Pattern: fixed divisions by zero with time sigs 1/16+
Setting time signatures 1/16+ lead to divisions by zero in two places. Fixed this by adding according qMax() call (closes #2818125). Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
This commit is contained in:
@@ -1244,7 +1244,8 @@ void patternView::paintEvent( QPaintEvent * )
|
||||
QPixmap stepoverlay;
|
||||
QPixmap stepoff;
|
||||
QPixmap stepoffl;
|
||||
const int steps = m_pat->length() / DefaultBeatsPerTact;
|
||||
const int steps = qMax( 1,
|
||||
m_pat->length() / DefaultBeatsPerTact );
|
||||
const int w = width() - 2 * TCO_BORDER_WIDTH;
|
||||
stepon = s_stepBtnOn->scaled( w / steps,
|
||||
s_stepBtnOn->height(),
|
||||
|
||||
Reference in New Issue
Block a user