p.setPen(base_->color());
- const int64_t points_count = end - start;
+ const int64_t points_count = end - start + 1;
QPointF *points = new QPointF[points_count];
QPointF *point = points;
segment->get_samples(start, start + sample_count, sample_block);
const int w = 2;
- for (int64_t sample = start; sample != end; sample++, block_sample++) {
+ for (int64_t sample = start; sample <= end; sample++, block_sample++) {
if (block_sample == TracePaintBlockSize) {
block_sample = 0;
segment->get_samples(sample, sample + sample_count, sample_block);
}
- const float x = (sample / samples_per_pixel -
- pixels_offset) + left;
+ const float x = left + (sample / samples_per_pixel - pixels_offset);
*point++ = QPointF(x, y - sample_block[block_sample] * scale_);