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++}; }