diff --git a/src/tracks/Pattern.cpp b/src/tracks/Pattern.cpp index 5306b218506..727fbd948fd 100644 --- a/src/tracks/Pattern.cpp +++ b/src/tracks/Pattern.cpp @@ -943,7 +943,9 @@ void PatternView::paintEvent( QPaintEvent * ) const float ppt = fixedTCOs() ? ( parentWidget()->width() - 2 * TCO_BORDER_WIDTH ) / (float) m_pat->length().getTact() : - pixelsPerTact(); + ( width() - 2 * TCO_BORDER_WIDTH ) + / (float) m_pat->length().getTact(); + const int x_base = TCO_BORDER_WIDTH; p.setPen( c.darker( 300 ) ); @@ -996,7 +998,7 @@ void PatternView::paintEvent( QPaintEvent * ) // qDebug( "keyrange: %d", keyrange ); // determine height of the pattern view, sans borders - const int ht = height() - 1 - TCO_BORDER_WIDTH * 2; + const int ht = (height() - 1 - TCO_BORDER_WIDTH * 2) -1; // determine maximum height value for drawing bounds checking const int max_ht = height() - 1 - TCO_BORDER_WIDTH; @@ -1021,7 +1023,7 @@ void PatternView::paintEvent( QPaintEvent * ) const float y_key = ( float( central_key - ( *it )->key() ) / keyrange + 1.0f ) / 2; // multiply that by pattern height - const int y_pos = static_cast( TCO_BORDER_WIDTH + y_key * ht ); + const int y_pos = static_cast( TCO_BORDER_WIDTH + y_key * ht ) + 1; // debug code // if( ( *it )->length() > 0 ) qDebug( "key %d, central_key %d, y_key %f, y_pos %d", ( *it )->key(), central_key, y_key, y_pos );