From 96051065db8a8196d45ac9e8084a821686b552fe Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Sun, 27 Apr 2008 13:44:20 -0500 Subject: [PATCH] Continue cleaning up scrolling issues. --- FL/Boxtypes.C | 2 +- Timeline/Sequence.C | 2 +- Timeline/Sequence_Widget.C | 5 ++++- Timeline/Timeline.C | 19 ++++++++++++++----- 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/FL/Boxtypes.C b/FL/Boxtypes.C index f876bd0..b23b32a 100644 --- a/FL/Boxtypes.C +++ b/FL/Boxtypes.C @@ -358,7 +358,7 @@ up_box ( int x, int y, int w, int h, Fl_Color c ) /* stipple */ fl_color( fl_color_average( FL_GRAY, c, 0.10f ) ); for ( int i = y + 1; i < y + h - 8; i += 5 ) - fl_line( x, i, x + w, i ); + fl_line( x + 1, i, x + w - 2, i ); frame_rect( x, y, w, h - 1, "IJLM", c ); } diff --git a/Timeline/Sequence.C b/Timeline/Sequence.C index 33d9ccc..1eccfb4 100644 --- a/Timeline/Sequence.C +++ b/Timeline/Sequence.C @@ -93,7 +93,7 @@ Sequence::draw ( void ) fl_push_clip( x(), y(), w(), h() ); /* draw the box with the ends cut off. */ - draw_box( box(), x() - Fl::box_dx( box() ), y(), w() + Fl::box_dw( box() ) + 1, h(), color() ); + draw_box( box(), x() - Fl::box_dx( box() ) - 1, y(), w() + Fl::box_dw( box() ) + 2, h(), color() ); int X, Y, W, H; diff --git a/Timeline/Sequence_Widget.C b/Timeline/Sequence_Widget.C index 0722248..2c724d4 100644 --- a/Timeline/Sequence_Widget.C +++ b/Timeline/Sequence_Widget.C @@ -224,7 +224,10 @@ Sequence_Widget::handle ( int m ) pos += d; timeline->xposition( timeline->ts_to_x( pos ) ); - _track->redraw(); + + /* FIXME: why isn't this enough? */ +// _track->redraw(); + timeline->redraw(); } return 1; diff --git a/Timeline/Timeline.C b/Timeline/Timeline.C index 6a009dc..e6e1f8d 100644 --- a/Timeline/Timeline.C +++ b/Timeline/Timeline.C @@ -291,6 +291,8 @@ Timeline::draw_measure ( int X, int Y, int W, int H, Fl_Color color, bool BBT ) if ( ! draw_with_measure_lines ) return; + fl_push_clip( X, Y, W, H ); + // fl_line_style( FL_DASH, 2 ); fl_line_style( FL_DASH, 0 ); @@ -299,6 +301,13 @@ Timeline::draw_measure ( int X, int Y, int W, int H, Fl_Color color, bool BBT ) const nframes_t samples_per_minute = sample_rate() * 60; + /* we need to back up a bit in order to catch all the numbers */ + if ( BBT ) + { + X -= 40; + W += 40; + } + for ( int x = X; x < X + W; ++x ) { // measure = ts_to_x( (double)(sample_rate() * 60) / beats_per_minute( x_to_ts( x - Track::width() ) + xoffset ) ); @@ -372,6 +381,7 @@ Timeline::draw_measure ( int X, int Y, int W, int H, Fl_Color color, bool BBT ) fl_line_style( FL_SOLID, 0 ); + fl_pop_clip(); } void @@ -479,11 +489,10 @@ Timeline::draw ( void ) /* return; */ /* } */ - if ( ( damage() & FL_DAMAGE_CHILD && damage() & FL_DAMAGE_SCROLL ) || - ( (damage() & FL_DAMAGE_ALL) - || - damage() & FL_DAMAGE_EXPOSE ) ) + if ( damage() & FL_DAMAGE_ALL || damage() & FL_DAMAGE_EXPOSE ) { + printf( "complete redraw\n" ); + draw_box( box(), 0, 0, w(), h(), color() ); fl_push_clip( 0, rulers->y(), w(), rulers->h() ); @@ -738,7 +747,7 @@ Timeline::handle ( int m ) { case FL_FOCUS: case FL_UNFOCUS: - redraw(); +// redraw(); return 1; case FL_KEYBOARD: case FL_SHORTCUT: