- const int start = a.front().start_sample() / samples_per_pixel -
- pixels_offset;
- const int end = a.back().end_sample() / samples_per_pixel -
- pixels_offset;
+ const double top = y + .5 - h / 2;
+ const double bottom = y + .5 + h / 2;
+ const double cap_width = min((end - start) / 4, EndCapWidth);
+
+ QPointF pts[] = {
+ QPointF(start, y + .5f),
+ QPointF(start + cap_width, top),
+ QPointF(end - cap_width, top),
+ QPointF(end, y + .5f),
+ QPointF(end - cap_width, bottom),
+ QPointF(start + cap_width, bottom)
+ };