diff --git a/Region.C b/Region.C index fd5a16c..6aa7fca 100644 --- a/Region.C +++ b/Region.C @@ -345,7 +345,8 @@ Region::draw ( int X, int Y, int W, int H ) fl_line( rx, Y, rx, Y + H ); fl_line( rx + rw - 1, Y, rx + rw - 1, Y + H ); - draw_label( _clip->name(), (Fl_Align)(FL_ALIGN_LEFT | FL_ALIGN_BOTTOM /*| FL_ALIGN_CLIP*/ | FL_ALIGN_INSIDE) ); + draw_label( _clip->name(), align() ); + /* if ( _selected ) */ diff --git a/Region.H b/Region.H index 81646a9..99c63c7 100644 --- a/Region.H +++ b/Region.H @@ -54,6 +54,7 @@ class Region : public Track_Widget public: Fl_Boxtype box ( void ) const { return Region::_box; } + Fl_Align align ( void ) const { return (Fl_Align)(FL_ALIGN_LEFT | FL_ALIGN_BOTTOM /*| FL_ALIGN_CLIP*/ | FL_ALIGN_INSIDE); } Region ( const Region & rhs ); Region ( Audio_File *c ); diff --git a/Timeline.H b/Timeline.H index 677267e..284e8a2 100644 --- a/Timeline.H +++ b/Timeline.H @@ -161,11 +161,13 @@ struct Timeline : public Fl_Group H = tracks->h(); + /* fl_color( FL_RED ); */ /* fl_rect( X, Y, X + W, Y + H ); */ if ( damage() & FL_DAMAGE_ALL ) { + Fl_Group::draw(); draw_clip( this, X, tracks->y(), W, tracks->h() ); draw_clip( this, X, rulers->y(), W, rulers->h() ); return; diff --git a/Track_Point.H b/Track_Point.H index 7df457a..aee085c 100644 --- a/Track_Point.H +++ b/Track_Point.H @@ -30,6 +30,7 @@ protected: public: + Fl_Align align ( void ) const { return FL_ALIGN_RIGHT; } int abs_w ( void ) const { return 10; } nframes_t length ( void ) const { return timeline->x_to_ts( abs_w() ); } @@ -43,6 +44,6 @@ public: { Track_Widget::draw( x(), Y, w(), H ); - draw_label( _label, FL_ALIGN_RIGHT ); + draw_label( _label, align() ); } }; diff --git a/Track_Widget.H b/Track_Widget.H index 6135d64..1b2aa72 100644 --- a/Track_Widget.H +++ b/Track_Widget.H @@ -95,11 +95,18 @@ public: virtual nframes_t length ( void ) const { return _end - _start; } virtual Fl_Boxtype box ( void ) const { return FL_UP_BOX; } + virtual Fl_Align align ( void ) const { return (Fl_Align)0; } - void + virtual void redraw ( void ) { - _track->damage( FL_DAMAGE_EXPOSE, x(), y(), w(), h() ); + if ( ! (align() & FL_ALIGN_INSIDE) ) + { + // FIXME: to better.. + _track->redraw(); + } + else + _track->damage( FL_DAMAGE_EXPOSE, x(), y(), w(), h() ); } /* just draw a simple box */ @@ -172,10 +179,9 @@ public: if ( align & FL_ALIGN_CLIP ) fl_push_clip( X, Y, W, H ); int dx = 0; - int tx = timeline->ts_to_x( _offset ); - if ( tx < scroll_x() ) - dx = min( 32767, scroll_x() - tx ); + if ( abs_x() < scroll_x() ) + dx = min( 32767, scroll_x() - abs_x() ); lab.draw( X - dx, Y, W, H, align );