From 604ad7f13fcaf19e2fee18a80b2b6d71cb013f1c Mon Sep 17 00:00:00 2001 From: mlangkabel Date: Fri, 24 Apr 2026 21:13:12 +0200 Subject: [PATCH] also use surface_mask to draw belts and splitters --- src/ui/GameWorldView.cpp | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/src/ui/GameWorldView.cpp b/src/ui/GameWorldView.cpp index bf3510f..241f038 100644 --- a/src/ui/GameWorldView.cpp +++ b/src/ui/GameWorldView.cpp @@ -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(), - b.footprint.width() * static_cast(tilePx()), - b.footprint.height() * static_cast(tilePx())); - } + const QPointF tl = tileToWidget(b.anchor); + const QRectF bboxRect(tl.x(), tl.y(), + b.footprint.width() * static_cast(tilePx()), + b.footprint.height() * static_cast(tilePx())); painter.setPen(QPen(bv.outline, 1)); painter.setBrush(Qt::NoBrush);