Fix error in waveform coloring.
This commit is contained in:
parent
f6d5123e35
commit
8d31a880b3
18
Waveform.C
18
Waveform.C
|
@ -56,22 +56,24 @@ draw_waveform ( int ox, int X, int Y, int W, int H, Audio_File *_clip, int chann
|
|||
|
||||
int mid = Y + (H / 2);
|
||||
|
||||
|
||||
p.max *= _scale;
|
||||
p.min *= _scale;
|
||||
|
||||
if ( vary_color )
|
||||
fl_color( fl_color_average( FL_RED, color, fabs( p.max - p.min ) - 1.0 ) );
|
||||
fl_color( fl_color_average( FL_RED, color, min( 1.0, fabs( p.max - p.min ) ) ) );
|
||||
else
|
||||
fl_color( color );
|
||||
|
||||
/* p.min = max( p.min, -1.0f ); */
|
||||
/* p.max = min( p.max, 1.0f ); */
|
||||
|
||||
/* if ( p.min < -1.0 || p.max > 1.0 ) */
|
||||
/* { */
|
||||
/* fl_color( FL_RED ); */
|
||||
/* fl_line( x, Y, x, Y + H ); */
|
||||
/* } */
|
||||
/* else */
|
||||
|
||||
if ( p.min < -1.0 || p.max > 1.0 )
|
||||
{
|
||||
fl_color( FL_RED );
|
||||
fl_line( x, Y, x, Y + H );
|
||||
}
|
||||
else
|
||||
fl_line( x, mid + (H / 2 * p.min), x, mid + (H / 2 * p.max) );
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue