mirror of
https://github.com/tobspr/shapez.io.git
synced 2024-10-27 20:34:29 +00:00
Prevent rendering selection outline twice
This commit is contained in:
parent
707323591b
commit
7a4fcb5c99
@ -271,10 +271,19 @@ export class HUDMassSelector extends BaseHUDPart {
|
||||
|
||||
parameters.context.fillStyle = THEME.map.selectionOverlay;
|
||||
|
||||
let renderedUids = new Set();
|
||||
|
||||
for (let x = realTileStart.x; x <= realTileEnd.x; ++x) {
|
||||
for (let y = realTileStart.y; y <= realTileEnd.y; ++y) {
|
||||
const contents = this.root.map.getLayerContentXY(x, y, this.root.currentLayer);
|
||||
if (contents && this.root.logic.canDeleteBuilding(contents)) {
|
||||
// Prevent rendering the overlay twice
|
||||
const uid = contents.uid;
|
||||
if (renderedUids.has(uid)) {
|
||||
continue;
|
||||
}
|
||||
renderedUids.add(uid);
|
||||
|
||||
const staticComp = contents.components.StaticMapEntity;
|
||||
const bounds = staticComp.getTileSpaceBounds();
|
||||
parameters.context.beginRoundedRect(
|
||||
|
Loading…
Reference in New Issue
Block a user