From af3698bebc8974078a6c609cd8661dcb3b897b96 Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Sat, 9 Jun 2012 19:08:49 -0700 Subject: [PATCH] Timeline: Fix sign error in region panning. --- timeline/src/Audio_Region.C | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/timeline/src/Audio_Region.C b/timeline/src/Audio_Region.C index d0423ba..3cc36b7 100644 --- a/timeline/src/Audio_Region.C +++ b/timeline/src/Audio_Region.C @@ -858,12 +858,18 @@ Audio_Region::handle ( int m ) { /* panning */ int d = (ox + X) - x(); - long td = timeline->x_to_ts( d ); - if ( td > 0 && os < (nframes_t)td ) - _r->offset = 0; + bool negative = d < 0; + + if ( d < 0 ) + _r->offset = os + timeline->x_to_ts( 0 - d ); else - _r->offset = os - td; + { + if ( os < timeline->x_to_ts( d ) ) + _r->offset = 0; + else + _r->offset = os - timeline->x_to_ts( d ); + } redraw(); return 1;