Browse Source

Clip selection rectangle to track area.

tags/non-daw-v1.1.0
Jonathan Moore Liles 17 years ago
parent
commit
73180334f3
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      Timeline.C

+ 5
- 1
Timeline.C View File

@@ -395,7 +395,9 @@ Timeline::draw_overlay ( void )
fl_color( FL_BLUE ); fl_color( FL_BLUE );
fl_line_style( FL_DOT, 4 ); fl_line_style( FL_DOT, 4 );


fl_push_clip( tracks->x() + Track_Header::width(), rulers->y() + rulers->h(), tracks->w() - Track_Header::width(), h() - rulers->h() - hscroll->h() );
fl_rect( _selection.x, _selection.y, _selection.w, _selection.h ); fl_rect( _selection.x, _selection.y, _selection.w, _selection.h );
fl_pop_clip();


fl_line_style( FL_SOLID, 0 ); fl_line_style( FL_SOLID, 0 );


@@ -407,11 +409,13 @@ Timeline::draw_overlay ( void )
void void
Timeline::select( const Rectangle &r ) Timeline::select( const Rectangle &r )
{ {
const int Y = r.y - yposition;

for ( int i = tracks->children(); i-- ; ) for ( int i = tracks->children(); i-- ; )
{ {
Track_Header *t = (Track_Header*)tracks->child( i ); Track_Header *t = (Track_Header*)tracks->child( i );


if ( t->y() >= r.y && t->y() + t->h() <= r.y + r.h )
if ( t->y() >= Y && t->y() + t->h() <= Y + r.h )
t->track()->select_range( r.x, r.w ); t->track()->select_range( r.x, r.w );
} }
} }


Loading…
Cancel
Save