Browse Source

Draw crossfades properly even when zoomed way in.

tags/non-daw-v1.1.0
Jonathan Moore Liles 17 years ago
parent
commit
4163d0230b
3 changed files with 18 additions and 4 deletions
  1. +2
    -2
      Timeline/Audio_Sequence.C
  2. +1
    -2
      Timeline/Sequence.C
  3. +15
    -0
      Timeline/Sequence_Widget.H

+ 2
- 2
Timeline/Audio_Sequence.C View File

@@ -159,7 +159,7 @@ Audio_Sequence::draw ( void )
/* if ( o->x() == (*r)->x() && o->w() == (*r)->w() ) */
/* printf( "complete superposition\n" ); */

if ( (*r)->x() >= o->x() && (*r)->x() + (*r)->w() <= o->x() + o->w() )
if ( o->contains( *r ) )
/* completely inside */
continue;

@@ -195,7 +195,7 @@ Audio_Sequence::draw ( void )
if ( *o <= **r )
{

if ( (*r)->x() >= o->x() && (*r)->x() + (*r)->w() <= o->x() + o->w() )
if ( o->contains( *r ) )
/* completely inside */
continue;



+ 1
- 2
Timeline/Sequence.C View File

@@ -101,14 +101,13 @@ Sequence::overlaps ( Sequence_Widget *r )
for ( list <Sequence_Widget *>::const_iterator i = _widgets.begin(); i != _widgets.end(); i++ )
{
if ( *i == r ) continue;
if ( ! ( (*i)->start() > r->start() + r->length() || (*i)->start() + (*i)->length() < r->start() ) )
if ( (*i)->overlaps( r ) )
return *i;
}

return NULL;
}


void
Sequence::draw ( void )
{


+ 15
- 0
Timeline/Sequence_Widget.H View File

@@ -314,6 +314,21 @@ public:

int active_r ( void ) const { return _sequence->active_r(); }




/** returns true if widget /w/ begins and ends completely within the range of this widget */
bool contains ( const Sequence_Widget *w ) const
{
return w->start() >= start() && w->start() + w->length() <= start() + length();
}

/** returns true of widget /w/ overlaps this widget in any place */
bool overlaps ( const Sequence_Widget *w ) const
{
return ! ( w->start() > start() + length() || w->start() + w->length() < start() );
}

virtual Fl_Boxtype box ( void ) const { return FL_UP_BOX; }
virtual Fl_Align align ( void ) const { return (Fl_Align)0; }



Loading…
Cancel
Save