Draw secondary cursors on timeline instead of in the overlay.

This commit is contained in:
Jonathan Moore Liles 2008-05-18 22:45:37 -05:00
parent ef254cfbae
commit 8d385de54c
1 changed files with 15 additions and 8 deletions

View File

@ -614,6 +614,13 @@ Timeline::draw ( void )
draw_child( *hscroll ); draw_child( *hscroll );
draw_child( *vscroll ); draw_child( *vscroll );
if ( p1 != p2 )
{
draw_cursor( p1, FL_BLUE );
draw_cursor( p2, FL_GREEN );
}
redraw_overlay(); redraw_overlay();
@ -684,6 +691,7 @@ done:
_old_xposition = xoffset; _old_xposition = xoffset;
_old_yposition = _yposition; _old_yposition = _yposition;
} }
void void
@ -702,9 +710,9 @@ Timeline::draw_cursor ( nframes_t frame, Fl_Color color )
fl_color( color ); fl_color( color );
const int y = rulers->y() + rulers->h(); const int y = rulers->y() + rulers->h();
const int h = this->h() - hscroll->h(); const int h = this->h() - hscroll->h() - 1;
fl_push_clip( Track::width(), y, tracks->w(), h ); fl_push_clip( tracks->x() + Track::width(), y, tracks->w(), h );
fl_line( x, y, x, h ); fl_line( x, y, x, h );
@ -744,12 +752,6 @@ Timeline::draw_cursor ( nframes_t frame, Fl_Color color )
void void
Timeline::draw_playhead ( void ) Timeline::draw_playhead ( void )
{ {
if ( p1 != p2 )
{
draw_cursor( p1, FL_BLUE );
draw_cursor( p2, FL_GREEN );
}
draw_cursor( transport->frame, FL_RED ); draw_cursor( transport->frame, FL_RED );
} }
@ -936,6 +938,9 @@ Timeline::handle ( int m )
p1 = xoffset + x_to_ts( X ); p1 = xoffset + x_to_ts( X );
} }
/* FIXME: only needs to damage the location of the old cursor! */
redraw();
return 1; return 1;
} }
case ']': case ']':
@ -947,6 +952,8 @@ Timeline::handle ( int m )
p2 = xoffset + x_to_ts( X ); p2 = xoffset + x_to_ts( X );
} }
/* FIXME: only needs to damage the location of the old cursor! */
redraw();
return 1; return 1;
} }
default: default: