also use surface_mask to draw belts and splitters
This commit is contained in:
@@ -538,23 +538,10 @@ void GameWorldView::drawBuildings(QPainter& painter)
|
|||||||
painter.fillRect(tileRect(cell), bv.fill);
|
painter.fillRect(tileRect(cell), bv.fill);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Belts and splitters are 1×1 on their body cell; other buildings use
|
const QPointF tl = tileToWidget(b.anchor);
|
||||||
// the full footprint bounding box for their outline and glyph.
|
const QRectF bboxRect(tl.x(), tl.y(),
|
||||||
QRectF bboxRect;
|
b.footprint.width() * static_cast<qreal>(tilePx()),
|
||||||
const bool isBeltLike = (b.type == BuildingType::Belt
|
b.footprint.height() * static_cast<qreal>(tilePx()));
|
||||||
|| b.type == BuildingType::Splitter);
|
|
||||||
if (isBeltLike && !b.bodyCells.empty())
|
|
||||||
{
|
|
||||||
const QPointF tl = tileToWidget(b.bodyCells[0]);
|
|
||||||
bboxRect = QRectF(tl.x(), tl.y(), tilePx(), tilePx());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
const QPointF tl = tileToWidget(b.anchor);
|
|
||||||
bboxRect = QRectF(tl.x(), tl.y(),
|
|
||||||
b.footprint.width() * static_cast<qreal>(tilePx()),
|
|
||||||
b.footprint.height() * static_cast<qreal>(tilePx()));
|
|
||||||
}
|
|
||||||
|
|
||||||
painter.setPen(QPen(bv.outline, 1));
|
painter.setPen(QPen(bv.outline, 1));
|
||||||
painter.setBrush(Qt::NoBrush);
|
painter.setBrush(Qt::NoBrush);
|
||||||
|
|||||||
Reference in New Issue
Block a user