Skip to content

Commit 8c2b331

Browse files
Copilotjbampton
andauthored
fix(code-breaker): draw pill at (0,0) so texture captures the full shape
Agent-Logs-Url: https://github.com/NextCommunity/NextCommunity.github.io/sessions/bb692ff9-eb4b-4e04-9a86-1f0552306666 Co-authored-by: jbampton <418747+jbampton@users.noreply.github.com>
1 parent b4a9424 commit 8c2b331

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/assets/js/games/code-breaker.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,15 @@ const CodeBreaker = (function () {
219219
// Generating again with the same key would be rejected by Phaser's
220220
// TextureManager and break subsequent tile rendering.
221221
if (!scene.textures.exists(textureKey)) {
222+
// Draw the pill starting at (0, 0) so the entire shape is captured by
223+
// the 100×28 generateTexture call. Drawing at (-50, -14) would place
224+
// the rect outside the capture region and produce a mostly-transparent
225+
// (effectively invisible) texture.
222226
const bg = scene.add.graphics();
223227
bg.fillStyle(hexColor, 0.25);
224-
bg.fillRoundedRect(-50, -14, 100, 28, 6);
228+
bg.fillRoundedRect(0, 0, 100, 28, 6);
225229
bg.lineStyle(1, hexColor, 0.8);
226-
bg.strokeRoundedRect(-50, -14, 100, 28, 6);
230+
bg.strokeRoundedRect(0, 0, 100, 28, 6);
227231
bg.generateTexture(textureKey, 100, 28);
228232
bg.destroy();
229233
}

0 commit comments

Comments
 (0)