Timeline: Fix error in drawing of region fade outs.
This commit is contained in:
parent
52150723c6
commit
6bbe69e712
|
@ -399,28 +399,16 @@ Audio_Region::draw_fade ( const Fade &fade, Fade::fade_dir_e dir, bool line, int
|
||||||
fl_vertex( fx, dy + height );
|
fl_vertex( fx, dy + height );
|
||||||
|
|
||||||
{
|
{
|
||||||
nframes_t tsx = timeline->x_to_ts( 1 );
|
const float ti = 1.0f / (float)width;
|
||||||
|
float ts = 0.0f;
|
||||||
|
|
||||||
|
const int xi = dir == Fade::In ? 1 : -1;
|
||||||
|
|
||||||
if ( dir == Fade::In )
|
for ( int i = 0; i < width; i++, ts += ti, fx += xi )
|
||||||
{
|
fl_vertex( fx, dy + height - ( height * fade.gain( ts )));
|
||||||
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 ) ));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( dir == Fade::In )
|
fl_vertex( fx, dy );
|
||||||
fl_vertex( fx + width, dy );
|
|
||||||
else
|
|
||||||
fl_vertex( fx - width, dy );
|
|
||||||
|
|
||||||
if ( line )
|
if ( line )
|
||||||
fl_end_line();
|
fl_end_line();
|
||||||
|
|
Loading…
Reference in New Issue