This commit is contained in:
Jonathan Moore Liles 2008-02-20 18:25:21 -06:00
parent 08182d2c5f
commit 2cc273ccc6
3 changed files with 14 additions and 11 deletions

View File

@ -300,16 +300,19 @@ Region::resize ( void )
int measure = 40;
/* Draw (part of) region. Start is */
/* Draw (part of) region. OX is pixel offset from start of timeline, X
Y W and H are the portion of the widget to draw (arrived at by
intersection of the clip and relative to OX) */
void
Region::draw ( int X, int Y, int W, int H )
Region::draw ( int OX, int X, int Y, int W, int H )
{
if ( ! ( W > 0 && H > 0 ) )
return;
if ( _offset > timeline.xoffset + timeline.x_to_ts( _track->w() ) ||
( _offset < timeline.xoffset &&
_offset + (_end - _start) < timeline.xoffset ) )
int ox = timeline.ts_to_x( _offset );
if ( ox > OX + _track->w() ||
ox < OX && ox + w() < OX )
return;
int rw = timeline.ts_to_x( _end - _start );
@ -318,9 +321,9 @@ Region::draw ( int X, int Y, int W, int H )
/* calculate waveform offset due to scrolling */
nframes_t offset = 0;
if ( _offset < timeline.xoffset )
if ( ox < OX )
{
offset = timeline.xoffset - _offset;
offset = timeline.x_to_ts( OX - ox );
rw = timeline.ts_to_x( (_end - _start) - offset );
}

View File

@ -80,7 +80,7 @@ public:
nframes_t length ( void ) const { return _end - _start; }
virtual void
draw ( int X, int Y, int W, int H )
draw ( int OX, int X, int Y, int W, int H )
{
fl_draw_box( FL_FLAT_BOX, X, Y, W, H, _box_color );
}
@ -97,7 +97,7 @@ class Tempo : public Track_Widget
float _tempo;
void
draw ( int X, int Y, int W, int H )
draw ( int OX, int X, int Y, int W, int H )
{
@ -130,7 +130,7 @@ public:
Region ( Clip *c );
int handle ( int m );
void draw ( int X, int Y, int W, int H );
void draw ( int OX, int X, int Y, int W, int H );
void resize ( void );
};

View File

@ -36,7 +36,7 @@ Track::draw ( void )
for ( list <Track_Widget *>::iterator r = _regions.begin(); r != _regions.end(); r++ )
{
// (*r)->draw( timeline.xoffset + x(), y(), w(), h() );
(*r)->draw( x(), y(), w(), h() );
(*r)->draw( timeline.ts_to_x( timeline.xoffset ), x(), y(), w(), h() );
}
fl_pop_clip();