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 */
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;