Fix for floating point conversion
This commit is contained in:
parent
ecc6f7b20f
commit
84f06503c6
2 changed files with 2 additions and 2 deletions
|
@ -52,7 +52,7 @@ void CardItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
|||
painter->setFont(f);
|
||||
painter->setBrush(QColor(200, 200, 200));
|
||||
painter->setPen(QPen(Qt::black));
|
||||
painter->drawRect(0.5, 0.5, CARD_WIDTH - 1, CARD_HEIGHT - 1);
|
||||
painter->drawRect(QRectF(0.5, 0.5, CARD_WIDTH - 1, CARD_HEIGHT - 1));
|
||||
painter->drawText(QRectF(5, 5, CARD_WIDTH - 15, CARD_HEIGHT - 15), Qt::AlignTop | Qt::AlignLeft | Qt::TextWordWrap, name);
|
||||
}
|
||||
painter->restore();
|
||||
|
|
|
@ -133,7 +133,7 @@ QPoint TableZone::mapToGrid(const QPointF &mapPoint) const
|
|||
else if (y > height - CARD_HEIGHT)
|
||||
y = height - CARD_HEIGHT;
|
||||
|
||||
return QPoint(round(((double) x * gridPointsPerCardX) / CARD_WIDTH), round(((double) y * gridPointsPerCardY) / CARD_HEIGHT));
|
||||
return QPoint((int) round(((double) x * gridPointsPerCardX) / CARD_WIDTH), (int) round(((double) y * gridPointsPerCardY) / CARD_HEIGHT));
|
||||
}
|
||||
|
||||
QPoint TableZone::getFreeGridPoint(int row) const
|
||||
|
|
Loading…
Reference in a new issue