diff --git a/Region.C b/Region.C index b27508f..512ef78 100644 --- a/Region.C +++ b/Region.C @@ -179,13 +179,19 @@ Region::handle ( int m ) if ( Fl::event_x() >= timeline.scroll->x() + timeline.scroll->w() || Fl::event_x() <= timeline.scroll->x() ) { - int d; + /* this drag needs to scroll */ + + long pos = timeline.scroll->xposition(); + if ( Fl::event_x() <= timeline.scroll->x() ) - d = -100; + pos -= 100; else - d = 100; - /* this drag needs to scroll */ - timeline.scroll->position( timeline.scroll->xposition() + d, timeline.scroll->yposition() ); + pos += 100; + + if ( pos < 0 ) + pos = 0; + + timeline.scroll->position( pos, timeline.scroll->yposition() ); } return 1; diff --git a/main.C b/main.C index cdb1b6f..05e9469 100644 --- a/main.C +++ b/main.C @@ -110,9 +110,9 @@ main ( int argc, char **argv ) Region *wave2 = new Region( *wave ); - wave2->peaks( peaks ); - wave2->start( 300 ); - wave2->end( len ); +/* wave2->peaks( peaks ); */ +/* wave2->start( 300 ); */ +/* wave2->end( len ); */ track2->add( wave2 );