- const QPointF highlight_points[] = {
- QPointF(r.right() - 1, r.top() + 1),
- QPointF(r.right() - 1, r.bottom() - 1),
- QPointF(h_centre + ArrowSize - 1, r.bottom() - 1),
- QPointF(h_centre, rect.bottom() - 1),
- QPointF(h_centre - ArrowSize + 1, r.bottom() - 1),
- QPointF(r.left() + 1, r.bottom() - 1),
- QPointF(r.left() + 1, r.top() + 1),
- };
-
- p.setPen(Qt::transparent);
- p.setBrush(FillColour);
- p.drawPolygon(points, countof(points));
-
- p.setPen(HighlightColour);
- p.setBrush(Qt::transparent);
- p.drawPolygon(highlight_points, countof(highlight_points));
-
- p.setPen(LineColour);
- p.setBrush(Qt::transparent);
- p.drawPolygon(points, countof(points));
-
- p.setPen(TextColour);
- p.drawText(r, Qt::AlignCenter | Qt::AlignVCenter,
- Ruler::format_time(_time, prefix, 2));
+ const QSizeF label_size(
+ text_size.width() + View::LabelPadding.width() * 2,
+ text_size.height() + View::LabelPadding.height() * 2);
+ const float top = rect.height() - label_size.height() -
+ TimeMarker::Offset - TimeMarker::ArrowSize - 0.5f;
+ const float height = label_size.height();
+
+ if (time_ > other->time())
+ return QRectF(x, top, label_size.width(), height);
+ else
+ return QRectF(x - label_size.width(), top,
+ label_size.width(), height);