diff --git a/include/midi_time.h b/include/midi_time.h index dfb8a1c90..620738177 100644 --- a/include/midi_time.h +++ b/include/midi_time.h @@ -135,7 +135,7 @@ public: static int stepsPerTact( void ) { - return ticksPerTact() / DefaultBeatsPerTact; + return qMax( 1, ticksPerTact() / DefaultBeatsPerTact ); } static void setTicksPerTact( tick_t _tpt ) diff --git a/src/tracks/pattern.cpp b/src/tracks/pattern.cpp index 307dc7910..cf137a3ff 100644 --- a/src/tracks/pattern.cpp +++ b/src/tracks/pattern.cpp @@ -1243,7 +1243,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(),