Browse Source

Timeline: Fix error in drawing of region fade outs.

tags/non-daw-v1.2.0
Jonathan Moore Liles 11 years ago
parent
commit
6bbe69e712
1 changed files with 7 additions and 19 deletions
  1. +7
    -19
      timeline/src/Audio_Region.C

+ 7
- 19
timeline/src/Audio_Region.C View File

@@ -399,28 +399,16 @@ Audio_Region::draw_fade ( const Fade &fade, Fade::fade_dir_e dir, bool line, int
fl_vertex( fx, dy + height );

{
nframes_t tsx = timeline->x_to_ts( 1 );

if ( dir == Fade::In )
{
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;
const float ti = 1.0f / (float)width;
float ts = 0.0f;
const int xi = dir == Fade::In ? 1 : -1;

for ( int i = 0; i < width; ++i, ts -= tsx )
fl_vertex( fx - i, dy + ( height * fade.gain( ts / (double)fade.length ) ));
}
for ( int i = 0; i < width; i++, ts += ti, fx += xi )
fl_vertex( fx, dy + height - ( height * fade.gain( ts )));
}
if ( dir == Fade::In )
fl_vertex( fx + width, dy );
else
fl_vertex( fx - width, dy );
fl_vertex( fx, dy );

if ( line )
fl_end_line();


Loading…
Cancel
Save