Redraw timeline background properly when scrolling.

pull/3/head
Jonathan Moore Liles 2008-04-27 23:42:05 -05:00
parent 5a4cb046d0
commit f7514d2fcf
3 changed files with 9 additions and 26 deletions

View File

@ -41,8 +41,6 @@ include ../make.inc
#LIBS:=$(LIBS) -ljack -lpthread
timeline: $(OBJS)
echo $(SRCS) >/dev/stderr
echo $(OBJS) >/dev/stderr
$(CXX) $(CXXFLAGS) $(INCLUDES) $(LIBS) -ljack -lpthread $(OBJS) -o $@ -L../FL -lfl_widgets
clean:

View File

@ -165,9 +165,9 @@ Timeline::Timeline ( int X, int Y, int W, int H, const char* L ) : Fl_Overlay_Wi
_length = -1;
{
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(), 1 );
o->type( Fl_Pack::VERTICAL );
o->spacing( 0 );
o->spacing( 1 );
tracks = o;
o->end();
@ -426,26 +426,16 @@ Timeline::draw_clip ( void * v, int X, int Y, int W, int H )
{
Timeline *tl = (Timeline *)v;
// printf( "draw_clip: %d,%d %dx%d\n", X, Y, W, H );
fl_push_clip( X, Y, W, H );
fl_color( rand() );
fl_rectf( X, Y, X + W, Y + H );
/* fl_color( rand() ); */
/* fl_rectf( X, Y, X + W, Y + H ); */
tl->draw_box();
tl->draw_child( *tl->rulers );
/* headers */
fl_push_clip( tl->tracks->x(), tl->rulers->y() + tl->rulers->h(), Track::width(), tl->h() - tl->rulers->h() - tl->hscroll->h() );
tl->draw_child( *tl->tracks );
fl_pop_clip();
/* track bodies */
fl_push_clip( tl->tracks->x() + Track::width(), tl->rulers->y() + tl->rulers->h(), tl->tracks->w() - Track::width(), tl->h() - tl->rulers->h() - tl->hscroll->h() );
tl->draw_child( *tl->tracks );
fl_pop_clip();
// tl->draw_child( *tl->tracks );
fl_pop_clip();
}
@ -562,12 +552,11 @@ Timeline::draw ( void )
if ( damage() & FL_DAMAGE_CHILD )
{
fl_push_clip( rulers->x(), rulers->y(), rulers->w(), rulers->h() );
update_child( *rulers );
fl_pop_clip();
fl_push_clip( tracks->x(), rulers->y() + rulers->h(), tracks->w(), hscroll->y() - (rulers->y() + rulers->h()) );
fl_push_clip( tracks->x(), tracks->y(), tracks->w(), h() - rulers->h() - hscroll->h() );
update_child( *tracks );
fl_pop_clip();

View File

@ -179,14 +179,13 @@ Track::init ( void )
o->add( "Show all takes", 0, 0, 0, FL_MENU_TOGGLE );
o->add( "New", 0, 0, 0, FL_MENU_DIVIDER );
}
o->end();
}
{
Fl_Box *o = new Fl_Box( 0, 76, 149, 38 );
o->box( FL_FLAT_BOX );
o->box( FL_NO_BOX );
Fl_Group::current()->resizable( o );
}
@ -215,10 +214,6 @@ Track::init ( void )
}
end();
/* /\* FIXME: should be configurable, but where? *\/ */
/* create_outputs( 2 ); */
/* create_inputs( 2 ); */
playback_ds = new Playback_DS( this, engine->frame_rate(), engine->nframes(), output.size() );
record_ds = new Record_DS( this, engine->frame_rate(), engine->nframes(), input.size() );
}
@ -286,8 +281,9 @@ Track::resize ( void )
else
controls->show();
/* FIXME: why is this necessary? */
if ( parent() )
parent()->redraw();
parent()->parent()->redraw();
}
void