Draw selection outline around selected scrap

Ring each selected scrap pile in the standard selection-outline color,
just outside its rendered circle, alongside the building outlines in
drawSelectionHighlights (REQ-UI-SCRAP-CLICK-SELECT).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DZR44tA8sn4dPqDzAVXyps
This commit is contained in:
2026-07-13 21:04:22 +02:00
parent b97ab1edaa
commit 7757bf4d48

View File

@@ -1083,6 +1083,19 @@ void GameWorldView::drawSelectionHighlights(QPainter& painter)
// Outline sits 1px outside the footprint (into adjacent tiles).
painter.drawRect(rect->adjusted(-1, -1, 1, 1));
}
// A ring around each selected scrap pile, sitting just outside the pile's
// rendered circle (radius tilePx()*0.2, matching drawScrap) (REQ-UI-SCRAP-CLICK-SELECT).
if (!m_selectedScrap.empty())
{
const qreal outlineRadius = static_cast<qreal>(tilePx() * 0.2f) + 3.0;
for (const ScrapInfo& scrap : m_sim->scraps().allScrapInfo())
{
if (std::find(m_selectedScrap.begin(), m_selectedScrap.end(), scrap.entity)
== m_selectedScrap.end()) { continue; }
painter.drawEllipse(worldToWidget(scrap.position), outlineRadius, outlineRadius);
}
}
}
void GameWorldView::drawCopyConfigFeedback(QPainter& painter)