Timeline: Fix scope of panzoomer when timeline is shorter than window width.

pull/3/head
Jonathan Moore Liles 2012-11-16 01:28:09 -08:00
parent 173ab99186
commit 9c1eb8276d
1 changed files with 7 additions and 3 deletions

View File

@ -155,7 +155,7 @@ protected:
void void
draw_background ( int X, int Y,int W, int H ) draw_background ( int X, int Y,int W, int H )
{ {
nframes_t ef = timeline->length(); nframes_t ef = timeline->x_to_ts( _xmax );
double ty = Y; double ty = Y;
@ -290,7 +290,11 @@ void
Timeline::adjust_panzoomer ( void ) Timeline::adjust_panzoomer ( void )
{ {
panzoomer->y_value( panzoomer->y_value(), h() - rulers->h() - panzoomer->h(), 0, pack_visible_height( tracks )); panzoomer->y_value( panzoomer->y_value(), h() - rulers->h() - panzoomer->h(), 0, pack_visible_height( tracks ));
panzoomer->x_value( ts_to_x( xoffset ), tracks->w() - Track::width(), 0, ts_to_x( length() ) ); panzoomer->x_value( ts_to_x( xoffset ), /* pos */
tracks->w() - Track::width(), /* window size */
0, /* min */
max( ts_to_x( length() ), tracks->w() - Track::width() )/* max */
);
} }
void void
@ -745,7 +749,7 @@ Timeline::Timeline ( int X, int Y, int W, int H, const char* L ) : BASE( X, Y, W
o->zoom( 8 ); o->zoom( 8 );
o->box( FL_FLAT_BOX ); o->box( FL_FLAT_BOX );
o->color( FL_BACKGROUND_COLOR ); o->color( FL_DARK1 );
o->type( FL_HORIZONTAL ); o->type( FL_HORIZONTAL );
o->callback( cb_scroll, this ); o->callback( cb_scroll, this );