Browse Source

More cleanups.

tags/non-daw-v1.1.0
Jonathan Moore Liles 17 years ago
parent
commit
3fbf9f9f82
3 changed files with 20 additions and 11 deletions
  1. +16
    -8
      Timeline.C
  2. +3
    -2
      Timeline.H
  3. +1
    -1
      Track_Widget.C

+ 16
- 8
Timeline.C View File

@@ -40,11 +40,9 @@ Timeline::cb_scroll ( Fl_Widget *w )
{ {
tracks->position( tracks->x(), (rulers->y() + rulers->h()) - vscroll->value() ); tracks->position( tracks->x(), (rulers->y() + rulers->h()) - vscroll->value() );


yposition = vscroll->value();
yposition( vscroll->value() );


vscroll->value( vscroll->value(), 30, 0, min( tracks->h(), tracks->h() - h() - rulers->h() ) ); vscroll->value( vscroll->value(), 30, 0, min( tracks->h(), tracks->h() - h() - rulers->h() ) );

damage( FL_DAMAGE_SCROLL );
} }
else else
{ {
@@ -59,7 +57,7 @@ Timeline::cb_scroll ( Fl_Widget *w )
} }
else else
{ {
position( hscroll->value() );
xposition( hscroll->value() );
} }
} }
} }
@@ -279,15 +277,25 @@ Timeline::draw_measure_lines ( int X, int Y, int W, int H, Fl_Color color )




void void
Timeline::position ( int X )
Timeline::xposition ( int X )
{ {
_old_xposition = xoffset;
// _old_xposition = xoffset;


xoffset = x_to_ts( X ); xoffset = x_to_ts( X );


damage( FL_DAMAGE_SCROLL ); damage( FL_DAMAGE_SCROLL );
} }


void
Timeline::yposition ( int Y )
{
// _old_yposition = _yposition;

_yposition = Y;

damage( FL_DAMAGE_SCROLL );
}

void void
Timeline::draw_clip ( void * v, int X, int Y, int W, int H ) Timeline::draw_clip ( void * v, int X, int Y, int W, int H )
{ {
@@ -369,7 +377,7 @@ Timeline::draw ( void )
if ( damage() & FL_DAMAGE_SCROLL ) if ( damage() & FL_DAMAGE_SCROLL )
{ {
int dx = ts_to_x( _old_xposition ) - ts_to_x( xoffset ); int dx = ts_to_x( _old_xposition ) - ts_to_x( xoffset );
int dy = _old_yposition - yposition;
int dy = _old_yposition - _yposition;


if ( ! dy ) if ( ! dy )
fl_scroll( X + Track_Header::width(), rulers->y(), rulers->w() - Fl::box_dw( rulers->child(0)->box() ), rulers->h(), dx, 0, draw_clip, this ); fl_scroll( X + Track_Header::width(), rulers->y(), rulers->w() - Fl::box_dw( rulers->child(0)->box() ), rulers->h(), dx, 0, draw_clip, this );
@@ -383,7 +391,7 @@ Timeline::draw ( void )
fl_scroll( X, Y, W, H, dx, dy, draw_clip, this ); fl_scroll( X, Y, W, H, dx, dy, draw_clip, this );


_old_xposition = xoffset; _old_xposition = xoffset;
_old_yposition = yposition;
_old_yposition = _yposition;


} }
} }


+ 3
- 2
Timeline.H View File

@@ -101,7 +101,7 @@ public:


nframes_t xoffset; nframes_t xoffset;


int yposition;
int _yposition;


Timeline ( int X, int Y, int W, int H, const char *L=0 ); Timeline ( int X, int Y, int W, int H, const char *L=0 );


@@ -117,7 +117,8 @@ public:
int nearest_line ( int ix ); int nearest_line ( int ix );


void draw_measure_lines ( int X, int Y, int W, int H, Fl_Color color ); void draw_measure_lines ( int X, int Y, int W, int H, Fl_Color color );
void position ( int X );
void xposition ( int X );
void yposition ( int Y );
void draw ( void ); void draw ( void );
void draw_overlay ( void ); void draw_overlay ( void );
int handle ( int m ); int handle ( int m );


+ 1
- 1
Track_Widget.C View File

@@ -214,7 +214,7 @@ Track_Widget::handle ( int m )
else else
pos += d; pos += d;


timeline->position( timeline->ts_to_x( pos ) );
timeline->xposition( timeline->ts_to_x( pos ) );
_track->redraw(); _track->redraw();
} }




Loading…
Cancel
Save