Browse Source

Fix problem interaction between waveform outlines and scrolling.

tags/non-daw-v1.1.0
Jonathan Moore Liles 17 years ago
parent
commit
e7ab9a3727
2 changed files with 17 additions and 10 deletions
  1. +5
    -1
      Timeline/Region.C
  2. +12
    -9
      Timeline/Waveform.C

+ 5
- 1
Timeline/Region.C View File

@@ -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() );
}
}



+ 12
- 9
Timeline/Waveform.C View File

@@ -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();
}

Loading…
Cancel
Save