From 20dd2adb3e9257dde12c09c7a02146000cbbe486 Mon Sep 17 00:00:00 2001 From: lllllllllwith10ls <38187754+lllllllllwith10ls@users.noreply.github.com> Date: Thu, 18 Jan 2024 19:04:23 -0600 Subject: [PATCH] pressure update --- mods/pressure.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/mods/pressure.js b/mods/pressure.js index 09861474..5453439e 100644 --- a/mods/pressure.js +++ b/mods/pressure.js @@ -231,6 +231,23 @@ drawPixels = function(forceTick=false) { if (ctx.globalAlpha < 1) { ctx.globalAlpha = 1; } + + if (elements[currentElement].maxSize < mouseSize) { + var mouseOffset = Math.trunc(elements[currentElement].maxSize/2); + } + else { + var mouseOffset = Math.trunc(mouseSize/2); + } + var topLeft = [mousePos.x-mouseOffset,mousePos.y-mouseOffset]; + var bottomRight = [mousePos.x+mouseOffset,mousePos.y+mouseOffset]; + // Draw a square around the mouse + ctx.strokeStyle = "white"; + ctx.strokeRect(topLeft[0]*pixelSize,topLeft[1]*pixelSize,(bottomRight[0]-topLeft[0]+1)*pixelSize,(bottomRight[1]-topLeft[1]+1)*pixelSize); + // draw one transparent pixel in the center + if (settings.precision) { + ctx.fillStyle = "rgba(255,255,255,0.5)"; + ctx.fillRect(mousePos.x*pixelSize,mousePos.y*pixelSize,pixelSize,pixelSize); + } if ((!paused) || forceTick) {pixelTicks++}; }