Browse Source

Timeline: Suppress measure line drawing at wide zoom levels.

tags/non-daw-v1.2.0
Jonathan Moore Liles 12 years ago
parent
commit
d455621543
2 changed files with 14 additions and 4 deletions
  1. +12
    -4
      timeline/src/Timeline.C
  2. +2
    -0
      timeline/src/Timeline.H

+ 12
- 4
timeline/src/Timeline.C View File

@@ -929,13 +929,21 @@ Timeline::x_to_offset ( int x ) const
} }


/** draws a single measure line */ /** 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; Fl_Color c = FL_LIGHT3;


if ( o->panzoomer->zoom() >= 15 )
return;

if ( bbt.beat ) if ( bbt.beat )
c = FL_DARK1;
if ( o->panzoomer->zoom() > 12 )
return;
else
c = FL_DARK1;


fl_color( fl_color_add_alpha( c, 64 ) ); 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 ); 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(); fl_pop_clip();
} }


+ 2
- 0
timeline/src/Timeline.H View File

@@ -121,6 +121,8 @@ class Timeline : public Fl_Single_Window, public RWLock
void menu_cb ( Fl_Menu_ *m ); void menu_cb ( Fl_Menu_ *m );
void fix_range ( void ); void fix_range ( void );


static void draw_measure_cb ( nframes_t frame, const BBT &bbt, void * );

int _fpp; /* frames per pixel, power of two */ int _fpp; /* frames per pixel, power of two */


// nframes_t p1, p2; /* cursors */ // nframes_t p1, p2; /* cursors */


Loading…
Cancel
Save