Browse Source

Timeline: Fix sign error allowing the beginning of mutliple region selection to be dragged to a position earlier than frame 0.

tags/non-daw-v1.2.0
Jonathan Moore Liles 12 years ago
parent
commit
252b105e67
1 changed files with 11 additions and 8 deletions
  1. +11
    -8
      timeline/src/Sequence_Widget.C

+ 11
- 8
timeline/src/Sequence_Widget.C View File

@@ -216,20 +216,21 @@ Sequence_Widget::start ( nframes_t where )
if ( this != Sequence_Widget::_current )
return;

long d = where - _r->start;
/* difference between where we are current and desired position */

if ( d < 0 )
if ( where < _r->start )
{
nframes_t d = _r->start - where;

/* first, make sure we stop at 0 */
nframes_t m = (nframes_t)-1;
nframes_t m = JACK_MAX_FRAMES;

for ( list <Sequence_Widget *>::iterator i = _selection.begin(); i != _selection.end(); ++i )
/* find the earliest region start point */
for ( list <Sequence_Widget *>::const_iterator i = _selection.begin(); i != _selection.end(); ++i )
m = min( m, (*i)->_r->start );

d = 0 - d;

if ( m <= (nframes_t)d )
d = m;
if ( d > m )
d = 0;

for ( list <Sequence_Widget *>::iterator i = _selection.begin(); i != _selection.end(); ++i )
{
@@ -239,6 +240,8 @@ Sequence_Widget::start ( nframes_t where )
}
else
{
nframes_t d = where - _r->start;

/* TODO: do like the above and disallow wrapping */
for ( list <Sequence_Widget *>::iterator i = _selection.begin(); i != _selection.end(); ++i )
{


Loading…
Cancel
Save