Draw crossfades properly even when zoomed way in.
This commit is contained in:
parent
ea8c35d0fe
commit
4163d0230b
|
@ -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;
|
||||
|
||||
|
|
|
@ -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 )
|
||||
{
|
||||
|
|
|
@ -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…
Reference in New Issue