13
0

Fix rendering of region waveform left-edge

The left-most part may be a partial block of a given "sample per pixel"
range. Also previously there was an off-by-one [block] in case
sample_pos was an even multiple of samples_per_visual_peak.
This commit is contained in:
Robin Gareus 2019-07-29 03:48:52 +02:00
parent a176efee02
commit a582b24fcd
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -647,9 +647,8 @@ AudioSource::read_peaks_with_fpp (PeakData *peaks, samplecnt_t npeaks, samplepos
samplecnt_t chunksize = (samplecnt_t) min (cnt, (samplecnt_t) 4096);
boost::scoped_array<Sample> raw_staging(new Sample[chunksize]);
samplepos_t sample_pos = start;
double pixel_pos = floor (sample_pos / samples_per_visual_peak);
double next_pixel_pos = ceil (sample_pos / samples_per_visual_peak);
double pixel_pos = start / samples_per_visual_peak;
double next_pixel_pos = 1.0 + floor (pixel_pos);
double pixels_per_sample = 1.0 / samples_per_visual_peak;
xmin = 1.0;