From cf68ac28621d17b4200e4803ca65a4f6ac94633f Mon Sep 17 00:00:00 2001 From: Malte Langkabel Date: Mon, 29 Jun 2026 20:09:10 +0000 Subject: [PATCH] Fix selected construction site border not being drawn (#2) Fixes a bug where the selected construction site was not drawn with a border. Reviewed-on: https://gitea.nebucryfar.loseyourip.com/mlangkabel/dota_factory/pulls/2 Co-authored-by: Malte Langkabel Co-committed-by: Malte Langkabel --- src/ui/GameWorldView.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/ui/GameWorldView.cpp b/src/ui/GameWorldView.cpp index 214a568..fcbe533 100644 --- a/src/ui/GameWorldView.cpp +++ b/src/ui/GameWorldView.cpp @@ -751,6 +751,20 @@ void GameWorldView::drawBuildings(QPainter& painter) painter.setBrush(Qt::NoBrush); painter.drawRect(bboxRect); + bool selected = false; + for (BuildingId selId : m_selectedBuildingIds) + { + if (selId == s.id) { selected = true; break; } + } + if (selected) + { + painter.setOpacity(1.0); + painter.setPen(QPen(m_visuals->overlays.selectedOutline, 2)); + painter.setBrush(Qt::NoBrush); + painter.drawRect(bboxRect.adjusted(-1, -1, 1, 1)); + painter.setOpacity(0.5); + } + const BuildingDef* siteDef = findBuildingDef(s.type); if (siteDef) {