From 9c1eb8276d7bf58cdba28416d599ad94fcb09ea5 Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Fri, 16 Nov 2012 01:28:09 -0800 Subject: [PATCH] Timeline: Fix scope of panzoomer when timeline is shorter than window width. --- timeline/src/Timeline.C | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/timeline/src/Timeline.C b/timeline/src/Timeline.C index 033ff13..29ea3cf 100644 --- a/timeline/src/Timeline.C +++ b/timeline/src/Timeline.C @@ -155,7 +155,7 @@ protected: void 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; @@ -290,7 +290,11 @@ void Timeline::adjust_panzoomer ( void ) { 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 @@ -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->box( FL_FLAT_BOX ); - o->color( FL_BACKGROUND_COLOR ); + o->color( FL_DARK1 ); o->type( FL_HORIZONTAL ); o->callback( cb_scroll, this );