From 6d1b06f4673d998bf8a5a7d60755ffda3e2b0601 Mon Sep 17 00:00:00 2001 From: Lily-129 <68935009+Lily-129@users.noreply.github.com> Date: Tue, 1 Mar 2022 12:15:16 -0500 Subject: [PATCH] gas charge fix --- mods/acidcircles.js | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/mods/acidcircles.js b/mods/acidcircles.js index 5b67c500..ead1ebf0 100644 --- a/mods/acidcircles.js +++ b/mods/acidcircles.js @@ -98,13 +98,21 @@ function drawPixels(forceTick=false) { ctx.arc((pixel.x+0.5)*pixelSize+(18*Math.sin((pixel.y+incrementt)/4.4)), (pixel.y+0.5)*pixelSize+(18*Math.sin((pixel.x+incrementt)/4.4)), pixelSize/2, 0, 2 * Math.PI, false); ctx.fill(); } - if (pixel.charge && view !== 2) { // Yellow glow on charge - if (!elements[pixel.element].colorOn) { - ctx.fillStyle = "rgba(255,255,0,0.5)"; - ctx.arc((pixel.x+0.5)*pixelSize+(18*Math.sin((pixel.y+incrementt)/4.4)), (pixel.y+0.5)*pixelSize+(18*Math.sin((pixel.x+incrementt)/4.4)), pixelSize/2, 0, 2 * Math.PI, false); - ctx.fill(); - } - } + if (pixel.charge && view !== 2) { // Yellow glow on charge + if (!elements[pixel.element].colorOn) { + 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+(18*Math.sin((pixel.y+incrementt)/4.4)), (pixel.y+0.5)*pixelSize+(18*Math.sin((pixel.x+incrementt)/4.4)), 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+(18*Math.sin((pixel.y+incrementt)/4.4)), (pixel.y+0.5)*pixelSize+(18*Math.sin((pixel.x+incrementt)/4.4)), pixelSize/2, 0, 2 * Math.PI, false); + ctx.fill(); + } + } + } } if ((!paused) || forceTick) {pixelTicks++}; -} \ No newline at end of file +}