Browse Source

Clean up measure line drawing.

tags/non-daw-v1.1.0
Jonathan Moore Liles 17 years ago
parent
commit
d573e394ec
1 changed files with 13 additions and 4 deletions
  1. +13
    -4
      Timeline.C

+ 13
- 4
Timeline.C View File

@@ -207,13 +207,22 @@ Timeline::draw_measure_lines ( int X, int Y, int W, int H, Fl_Color color )
{
measure = ts_to_x( (double)(sample_rate * 60) / beats_per_minute( x_to_ts( x ) + xoffset ));

/* don't bother with lines this close together */
if ( measure < 4 )
break;
if ( 0 == (x / measure) % beats_per_bar( x_to_ts( x ) + xoffset ) )
int bpb = beats_per_bar( x_to_ts( x ) + xoffset );

if ( 0 == (x / measure) % bpb )
{
if ( measure * bpb < 8 )
break;

fl_color( bar );
}
else
{
if ( measure < 8 )
continue;

fl_color( beat );
}

if ( 0 == (ts_to_x( xoffset ) + x) % measure )
fl_line( x, Y, x, Y + H );


Loading…
Cancel
Save