Skip to content

Commit

Permalink
Merge pull request #1506 from curlymorphic/i1255
Browse files Browse the repository at this point in the history
Proposed fix for 1255 Segment/clip not showing whole last note in Song E...
  • Loading branch information
diizy committed Jan 4, 2015
2 parents 146577d + a42d8a0 commit 469cb98
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/tracks/Pattern.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) );
Expand Down Expand Up @@ -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;
Expand All @@ -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<int>( TCO_BORDER_WIDTH + y_key * ht );
const int y_pos = static_cast<int>( 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 );
Expand Down

0 comments on commit 469cb98

Please sign in to comment.