From 089d9ab4027dac02bc0e50b3e279a6359a85e202 Mon Sep 17 00:00:00 2001 From: Aotumuri Date: Wed, 10 Dec 2025 12:43:48 +0900 Subject: [PATCH] Fix: update renderSprites based on user settings in SpriteFactory (#2574) Resolves #2573 ## Description: Fixed an issue where structure icons became smaller after upgrading a building. In StructureDrawingUtils.ts, renderSprites was always set to true and never updated, which caused the code to consistently select the scaled-down icon. This appears to have been the root cause of the problem. Since StructureIconsLayer (the caller of StructureDrawingUtils) updates renderSprites based on settings, I aligned the behavior accordingly. ```ts if (type === "icon") { const s = scale >= ZOOM_THRESHOLD && !this.renderSprites ? Math.max(1, scale / ICON_SCALE_FACTOR_ZOOMED_IN) : Math.min(1, scale / ICON_SCALE_FACTOR_ZOOMED_OUT); parentContainer.scale.set(s); } ``` Here is the video demonstrating the behavior after the fix. Please see the linked issue for the pre-fix behavior. https://github.com/user-attachments/assets/24c11a39-667e-49eb-adfe-f0c400d91e54 ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced ## Please put your Discord username so you can be contacted if a bug or regression is found: aotumuri --- src/client/graphics/layers/StructureDrawingUtils.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/client/graphics/layers/StructureDrawingUtils.ts b/src/client/graphics/layers/StructureDrawingUtils.ts index 31a13b036..db34d496a 100644 --- a/src/client/graphics/layers/StructureDrawingUtils.ts +++ b/src/client/graphics/layers/StructureDrawingUtils.ts @@ -148,6 +148,9 @@ export class SpriteFactory { const { type, stage } = options; const { scale } = this.transformHandler; + this.renderSprites = + this.game.config().userSettings()?.structureSprites() ?? true; + if (type === "icon" || type === "dot") { const texture = this.createTexture( structureType,