Timeline: Fix sign error in region panning.

This commit is contained in:
Jonathan Moore Liles 2012-06-09 19:08:49 -07:00
parent 1d59665702
commit af3698bebc
1 changed files with 10 additions and 4 deletions

View File

@ -858,12 +858,18 @@ Audio_Region::handle ( int m )
{ {
/* panning */ /* panning */
int d = (ox + X) - x(); int d = (ox + X) - x();
long td = timeline->x_to_ts( d );
if ( td > 0 && os < (nframes_t)td ) bool negative = d < 0;
if ( d < 0 )
_r->offset = os + timeline->x_to_ts( 0 - d );
else
{
if ( os < timeline->x_to_ts( d ) )
_r->offset = 0; _r->offset = 0;
else else
_r->offset = os - td; _r->offset = os - timeline->x_to_ts( d );
}
redraw(); redraw();
return 1; return 1;