Clean up trimming extremes.
This commit is contained in:
parent
668a568d42
commit
54f2d107d4
8
Region.C
8
Region.C
|
@ -116,6 +116,9 @@ Region::trim ( enum trim_e t, int X )
|
|||
if ( td < 0 && _start < 0 - td )
|
||||
td = 0 - _start;
|
||||
|
||||
if ( _start + td >= _end )
|
||||
td = (_end - _start) - timeline->x_to_ts( 1 );
|
||||
|
||||
_start += td;
|
||||
_offset += td;
|
||||
break;
|
||||
|
@ -128,6 +131,11 @@ Region::trim ( enum trim_e t, int X )
|
|||
|
||||
long td = timeline->x_to_ts( d );
|
||||
|
||||
printf( "%li %li\n", td, _end - _start );
|
||||
|
||||
if ( td >= 0 && _end - _start < td )
|
||||
_end = _start + timeline->x_to_ts( 1 );
|
||||
else
|
||||
_end -= td;
|
||||
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue