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);
|
||||
}
|
||||
|
||||
// Belts and splitters are 1×1 on their body cell; other buildings use
|
||||
// the full footprint bounding box for their outline and glyph.
|
||||
QRectF bboxRect;
|
||||
const bool isBeltLike = (b.type == BuildingType::Belt
|
||||
|| 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(),
|
||||
const QRectF bboxRect(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.setBrush(Qt::NoBrush);
|
||||
|
||||
Reference in New Issue
Block a user