From e7ab9a3727b26e50eb5cbd5d2118c84f6b4352a5 Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Wed, 30 Apr 2008 01:09:50 -0500 Subject: [PATCH] Fix problem interaction between waveform outlines and scrolling. --- Timeline/Region.C | 6 +++++- Timeline/Waveform.C | 21 ++++++++++++--------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/Timeline/Region.C b/Timeline/Region.C index 9773507..0406e56 100644 --- a/Timeline/Region.C +++ b/Timeline/Region.C @@ -610,6 +610,10 @@ Region::draw ( void ) /* no coverage */ return; + /* account for waveform outlines... */ + X -= 2; + W += 4; + int OX = scroll_x(); int ox = timeline->ts_to_x( _r->offset ); @@ -915,7 +919,7 @@ Region::write ( nframes_t nframes ) if ( W ) { ++W; - track()->damage( FL_DAMAGE_EXPOSE, x() + w() - W, y(), W, h() ); + track()->damage( FL_DAMAGE_ALL, x() + w() - W, y(), W, h() ); } } diff --git a/Timeline/Waveform.C b/Timeline/Waveform.C index 03ca6c0..89ba427 100644 --- a/Timeline/Waveform.C +++ b/Timeline/Waveform.C @@ -46,7 +46,7 @@ Waveform::draw ( int X, int Y, int W, int H, Peak *pbuf, int peaks, int skip, Fl_Color color ) { - fl_push_clip( X, Y, W, H ); +// fl_push_clip( X, Y, W, H ); int j; @@ -86,12 +86,12 @@ Waveform::draw ( int X, int Y, int W, int H, const int by = mid + ( halfheight * p.max ); fl_line( x, ty, x, by ); -/* if ( outline ) */ -/* { */ -/* fl_color( fl_darker( fl_darker( color ) ) ); */ -/* fl_line( x, ty - 2, x, ty ); */ -/* fl_line( x, by + 2, x, by ); */ -/* } */ +/* if ( outline ) */ +/* { */ +/* fl_color( fl_darker( fl_darker( color ) ) ); */ +/* fl_line( x, ty - 2, x, ty ); */ +/* fl_line( x, by + 2, x, by ); */ +/* } */ } } @@ -103,11 +103,13 @@ Waveform::draw ( int X, int Y, int W, int H, fl_color( fl_darker( fl_darker( color ) ) ); - fl_line_style( FL_SOLID, 2 ); + fl_line_style( FL_SOLID | FL_CAP_FLAT, 2 ); +// fl_line_style( FL_SOLID, 0 ); fl_begin_line(); j = start; + for ( int x = X; x < X + W; ++x, j += skip ) fl_vertex( x, ty + ( halfheight * pbuf[ j ].min ) ); @@ -116,6 +118,7 @@ Waveform::draw ( int X, int Y, int W, int H, fl_begin_line(); j = start; + for ( int x = X; x < X + W; ++x, j += skip ) fl_vertex( x, ty + ( halfheight * pbuf[ j ].max ) ); @@ -125,5 +128,5 @@ Waveform::draw ( int X, int Y, int W, int H, } - fl_pop_clip(); +// fl_pop_clip(); }