1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-24 11:45:53 +01:00

Fixed date background rendering issue

This commit is contained in:
Martin Tůma 2021-02-06 15:43:20 +01:00
parent 7604346799
commit f2e91f4a6b

View File

@ -44,17 +44,17 @@ void MarkerInfoItem::paint(QPainter *painter, const QStyleOptionGraphicsItem
Q_UNUSED(widget);
QFontMetrics fm(_font);
QRectF ry(OFFSET, -fm.height() + fm.descent(),
fm.boundingRect(_time).width(), fm.height() - fm.descent());
QRectF rx(OFFSET, 0, fm.boundingRect(_date).width(), fm.height()
QRectF rd(OFFSET, -fm.height() + fm.descent(),
fm.boundingRect(_date).width(), fm.height() - fm.descent());
QRectF rt(OFFSET, 0, fm.boundingRect(_time).width(), fm.height()
- fm.descent());
painter->setPen(Qt::NoPen);
QColor bc(painter->background().color());
bc.setAlpha(196);
painter->setBrush(QBrush(bc));
painter->drawRect(ry);
painter->drawRect(rx);
painter->drawRect(rt);
painter->drawRect(rd);
painter->setBrush(Qt::NoBrush);
painter->setFont(_font);