Merge branch 'master' of ssh://cockatrice.git.sourceforge.net/gitroot/cockatrice/cockatrice
This commit is contained in:
commit
b667e1f60b
10 changed files with 46 additions and 45 deletions
|
@ -6,7 +6,6 @@ MOC_DIR = build
|
||||||
OBJECTS_DIR = build
|
OBJECTS_DIR = build
|
||||||
RESOURCES = cockatrice.qrc
|
RESOURCES = cockatrice.qrc
|
||||||
QT += network svg
|
QT += network svg
|
||||||
CONFIG += debug
|
|
||||||
|
|
||||||
HEADERS += src/counter.h \
|
HEADERS += src/counter.h \
|
||||||
src/dlg_creategame.h \
|
src/dlg_creategame.h \
|
||||||
|
|
|
@ -118,7 +118,7 @@ void AbstractCardItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *
|
||||||
|
|
||||||
transformPainter(painter, translatedSize);
|
transformPainter(painter, translatedSize);
|
||||||
painter->setPen(textColor);
|
painter->setPen(textColor);
|
||||||
painter->drawText(QRectF(2 * scaleFactor, 2 * scaleFactor, translatedSize.width() - 4 * scaleFactor, translatedSize.height() - 4 * scaleFactor), Qt::AlignTop | Qt::AlignLeft | Qt::TextWrapAnywhere, name);
|
painter->drawText(QRectF(4 * scaleFactor, 4 * scaleFactor, translatedSize.width() - 8 * scaleFactor, translatedSize.height() - 8 * scaleFactor), Qt::AlignTop | Qt::AlignLeft | Qt::TextWrapAnywhere, name);
|
||||||
}
|
}
|
||||||
painter->restore();
|
painter->restore();
|
||||||
|
|
||||||
|
|
|
@ -172,12 +172,14 @@ void CardItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||||
if (!pt.isEmpty()) {
|
if (!pt.isEmpty()) {
|
||||||
painter->save();
|
painter->save();
|
||||||
QSizeF translatedSize = getTranslatedSize(painter);
|
QSizeF translatedSize = getTranslatedSize(painter);
|
||||||
|
|
||||||
|
qreal scaleFactor = translatedSize.width() / boundingRect().width();
|
||||||
transformPainter(painter, translatedSize);
|
transformPainter(painter, translatedSize);
|
||||||
painter->setBackground(Qt::black);
|
painter->setBackground(Qt::black);
|
||||||
painter->setBackgroundMode(Qt::OpaqueMode);
|
painter->setBackgroundMode(Qt::OpaqueMode);
|
||||||
painter->setPen(Qt::white);
|
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();
|
painter->restore();
|
||||||
}
|
}
|
||||||
if (getBeingPointedAt())
|
if (getBeingPointedAt())
|
||||||
|
|
Loading…
Reference in a new issue