From bcbed3959c46728e8d1f7d109d4c8bfd5d7bcb5d Mon Sep 17 00:00:00 2001 From: Lily-129 <68935009+Lily-129@users.noreply.github.com> Date: Tue, 1 Mar 2022 12:15:02 -0500 Subject: [PATCH] gas charge fix --- mods/circles.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/mods/circles.js b/mods/circles.js index 6555d870..0bb8dd91 100644 --- a/mods/circles.js +++ b/mods/circles.js @@ -92,10 +92,17 @@ } if (pixel.charge && view !== 2) { // Yellow glow on charge if (!elements[pixel.element].colorOn) { - ctx.fillStyle = "rgba(255,255,0,0.5)"; - ctx.beginPath(); - ctx.arc((pixel.x+0.5)*pixelSize, (pixel.y+0.5)*pixelSize, pixelSize/2, 0, 2 * Math.PI, false); - ctx.fill(); + if ((view === null || view === 4) && elements[pixel.element].state === "gas") { + ctx.fillStyle = "rgba(255,255,0,0.5)"; + ctx.beginPath(); + ctx.arc((pixel.x+0.5)*pixelSize, (pixel.y+0.5)*pixelSize, pixelSize*1.5, 0, 2 * Math.PI, false); + ctx.fill(); + } else { + ctx.fillStyle = "rgba(255,255,0,0.5)"; + ctx.beginPath(); + ctx.arc((pixel.x+0.5)*pixelSize, (pixel.y+0.5)*pixelSize, pixelSize/2, 0, 2 * Math.PI, false); + ctx.fill(); + } } } }