mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 08:34:52 -07:00
Text rendering fix
This commit is contained in:
parent
dd7f87242a
commit
76512a0870
10 changed files with 46 additions and 45 deletions
|
|
@ -172,12 +172,14 @@ void CardItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
|||
if (!pt.isEmpty()) {
|
||||
painter->save();
|
||||
QSizeF translatedSize = getTranslatedSize(painter);
|
||||
|
||||
qreal scaleFactor = translatedSize.width() / boundingRect().width();
|
||||
transformPainter(painter, translatedSize);
|
||||
painter->setBackground(Qt::black);
|
||||
painter->setBackgroundMode(Qt::OpaqueMode);
|
||||
painter->setPen(Qt::white);
|
||||
|
||||
painter->drawText(QRectF(2, 2, translatedSize.width() - 4, translatedSize.height() - 4), Qt::AlignRight | Qt::AlignBottom, pt);
|
||||
painter->drawText(QRectF(4 * scaleFactor, 4 * scaleFactor, translatedSize.width() - 8, translatedSize.height() - 8), Qt::AlignRight | Qt::AlignBottom, pt);
|
||||
painter->restore();
|
||||
}
|
||||
if (getBeingPointedAt())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue