Timeline: Tweak fade drawing.
This commit is contained in:
parent
3cca1e48a5
commit
72a0c0eb3e
|
@ -400,43 +400,42 @@ Audio_Region::draw_fade ( const Fade &fade, Fade::fade_dir_e dir, bool line, int
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
fl_push_matrix();
|
|
||||||
|
|
||||||
fl_translate( fx, dy );
|
|
||||||
|
|
||||||
if ( dir == Fade::In )
|
|
||||||
fl_scale( width, height );
|
|
||||||
else
|
|
||||||
fl_scale( -width, height );
|
|
||||||
|
|
||||||
if ( line )
|
if ( line )
|
||||||
fl_begin_line();
|
fl_begin_line();
|
||||||
else
|
else
|
||||||
fl_begin_polygon();
|
fl_begin_polygon();
|
||||||
|
|
||||||
fl_vertex( 0.0, 0.0 );
|
fl_vertex( fx, dy );
|
||||||
fl_vertex( 0.0, 1.0 );
|
fl_vertex( fx, dy + height );
|
||||||
|
|
||||||
|
|
||||||
// if ( draw_real_fade_curve )
|
|
||||||
{
|
{
|
||||||
nframes_t tsx = timeline->x_to_ts( 1 );
|
nframes_t tsx = timeline->x_to_ts( 1 );
|
||||||
nframes_t ts = 0;
|
|
||||||
|
|
||||||
for ( int i = 0; i < width; ++i, ts += tsx )
|
if ( dir == Fade::In )
|
||||||
fl_vertex( i / (double)width, 1.0f - fade.gain( ts / (double)fade.length ) );
|
{
|
||||||
|
nframes_t ts = 0;
|
||||||
|
|
||||||
|
for ( int i = 0; i < width; ++i, ts += tsx )
|
||||||
|
fl_vertex( fx + i, dy + height - ( height * fade.gain( ts / (double)fade.length ) ));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
nframes_t ts = tsx * width;
|
||||||
|
|
||||||
|
for ( int i = 0; i < width; ++i, ts -= tsx )
|
||||||
|
fl_vertex( fx - i, dy + ( height * fade.gain( ts / (double)fade.length ) ));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fl_vertex( 1.0, 0.0 );
|
if ( dir == Fade::In )
|
||||||
|
fl_vertex( fx + width, dy );
|
||||||
|
else
|
||||||
|
fl_vertex( fx - width, dy );
|
||||||
|
|
||||||
if ( line )
|
if ( line )
|
||||||
fl_end_line();
|
fl_end_line();
|
||||||
else
|
else
|
||||||
fl_end_polygon();
|
fl_end_polygon();
|
||||||
|
|
||||||
fl_pop_matrix();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in New Issue