Clean up trimming extremes.

This commit is contained in:
Jonathan Moore Liles 2008-02-23 20:25:58 -06:00
parent 668a568d42
commit 54f2d107d4
1 changed files with 10 additions and 2 deletions

View File

@ -113,9 +113,12 @@ Region::trim ( enum trim_e t, int X )
long td = timeline->x_to_ts( d ); long td = timeline->x_to_ts( d );
if ( td < 0 && _start < 0 - td ) if ( td < 0 && _start < 0 - td )
td = 0 - _start; td = 0 - _start;
if ( _start + td >= _end )
td = (_end - _start) - timeline->x_to_ts( 1 );
_start += td; _start += td;
_offset += td; _offset += td;
break; break;
@ -128,7 +131,12 @@ Region::trim ( enum trim_e t, int X )
long td = timeline->x_to_ts( d ); long td = timeline->x_to_ts( d );
_end -= td; printf( "%li %li\n", td, _end - _start );
if ( td >= 0 && _end - _start < td )
_end = _start + timeline->x_to_ts( 1 );
else
_end -= td;
break; break;
} }