Clean up some drawing issues.

This commit is contained in:
Jonathan Moore Liles 2008-03-01 09:48:15 -06:00
parent c9926362a7
commit fbb9ca3c4c
2 changed files with 14 additions and 9 deletions

View File

@ -150,7 +150,7 @@ Timeline::Timeline ( int X, int Y, int W, int H, const char* L ) : Fl_Overlay_Wi
{ {
Fl_Pack *o = new Fl_Pack( X, rulers->y() + rulers->h(), W - vscroll->w(), 5000 ); Fl_Pack *o = new Fl_Pack( X, rulers->y() + rulers->h(), W - vscroll->w(), 5000 );
o->type( Fl_Pack::VERTICAL ); o->type( Fl_Pack::VERTICAL );
o->spacing( 5 ); o->spacing( 0 );
Track *l = NULL; Track *l = NULL;
for ( int i = 16; i--; ) for ( int i = 16; i--; )
@ -236,7 +236,8 @@ Timeline::draw_measure_lines ( int X, int Y, int W, int H, Fl_Color color )
if ( ! _enable_measure_lines ) if ( ! _enable_measure_lines )
return; return;
fl_line_style( FL_DASH, 2 ); // fl_line_style( FL_DASH, 2 );
fl_line_style( FL_DASH, 0 );
Fl_Color beat = fl_color_average( FL_BLACK, color, 0.65f ); Fl_Color beat = fl_color_average( FL_BLACK, color, 0.65f );
Fl_Color bar = fl_color_average( FL_RED, color, 0.65f ); Fl_Color bar = fl_color_average( FL_RED, color, 0.65f );
@ -328,7 +329,9 @@ Timeline::draw ( void )
W = tracks->w() - Fl::box_dw( tracks->child( 0 )->box() ) - 1; W = tracks->w() - Fl::box_dw( tracks->child( 0 )->box() ) - 1;
H = tracks->h(); H = tracks->h();
if ( damage() & FL_DAMAGE_ALL ) if ( (damage() & FL_DAMAGE_ALL)
||
damage() & FL_DAMAGE_EXPOSE )
{ {
draw_box( box(), 0, 0, w(), h(), color() ); draw_box( box(), 0, 0, w(), h(), color() );
@ -336,19 +339,21 @@ Timeline::draw ( void )
draw_child( *rulers ); draw_child( *rulers );
fl_pop_clip(); fl_pop_clip();
fl_push_clip( tracks->x(), rulers->y() + rulers->h(), tracks->w(), h() - hscroll->h() ); fl_push_clip( tracks->x(), rulers->y() + rulers->h(), tracks->w(), hscroll->y() - (rulers->y() + rulers->h()) );
draw_child( *tracks ); draw_child( *tracks );
fl_pop_clip(); fl_pop_clip();
draw_child( *hscroll ); draw_child( *hscroll );
draw_child( *vscroll ); draw_child( *vscroll );
redraw_overlay(); // redraw_overlay();
return; return;
} }
if ( damage() & FL_DAMAGE_CHILD ) if ( damage() & FL_DAMAGE_CHILD )
{ {
// draw_box( box(), 0, 0, w(), h(), color() );
fl_push_clip( rulers->x(), rulers->y(), rulers->w() - vscroll->w(), rulers->h() ); fl_push_clip( rulers->x(), rulers->y(), rulers->w() - vscroll->w(), rulers->h() );
update_child( *rulers ); update_child( *rulers );
fl_pop_clip(); fl_pop_clip();

View File

@ -51,7 +51,7 @@ Track::draw ( void )
if ( ! fl_not_clipped( x(), y(), w(), h() ) ) if ( ! fl_not_clipped( x(), y(), w(), h() ) )
return; return;
/* fl_push_clip( x(), y(), w(), h() ); */ fl_push_clip( x(), y(), w(), h() );
Fl_Group::draw(); Fl_Group::draw();
@ -70,7 +70,7 @@ Track::draw ( void )
for ( list <Track_Widget *>::const_iterator r = _widgets.begin(); r != _widgets.end(); r++ ) for ( list <Track_Widget *>::const_iterator r = _widgets.begin(); r != _widgets.end(); r++ )
(*r)->draw( X, Y, W, H ); (*r)->draw( X, Y, W, H );
/* fl_pop_clip(); */ fl_pop_clip();
} }
void void