Timeline: Suppress measure line drawing at wide zoom levels.

pull/3/head
Jonathan Moore Liles 2012-12-11 22:13:18 -08:00
parent a985cb3168
commit d455621543
2 changed files with 14 additions and 4 deletions

View File

@ -929,13 +929,21 @@ Timeline::x_to_offset ( int x ) const
}
/** draws a single measure line */
static void
draw_measure_cb ( nframes_t frame, const BBT &bbt, void * )
void
Timeline::draw_measure_cb ( nframes_t frame, const BBT &bbt, void *v )
{
Timeline *o = (Timeline*)v;
Fl_Color c = FL_LIGHT3;
if ( o->panzoomer->zoom() >= 15 )
return;
if ( bbt.beat )
c = FL_DARK1;
if ( o->panzoomer->zoom() > 12 )
return;
else
c = FL_DARK1;
fl_color( fl_color_add_alpha( c, 64 ) );
@ -1098,7 +1106,7 @@ Timeline::draw_measure_lines ( int X, int Y, int W, int H )
fl_push_clip( X, Y, W, H );
render_tempomap( start, length, draw_measure_cb, NULL );
render_tempomap( start, length, draw_measure_cb, this );
fl_pop_clip();
}

View File

@ -121,6 +121,8 @@ class Timeline : public Fl_Single_Window, public RWLock
void menu_cb ( Fl_Menu_ *m );
void fix_range ( void );
static void draw_measure_cb ( nframes_t frame, const BBT &bbt, void * );
int _fpp; /* frames per pixel, power of two */
// nframes_t p1, p2; /* cursors */