yeah overmasking is _definitely_ fixed, works great now

This commit is contained in:
tim h 2022-11-20 17:21:55 -06:00
parent 959bb4f8b1
commit 32904051aa

View file

@ -646,6 +646,7 @@ function mouseUp(evt) {
initImgData.data[i + 3] = imgChunkData[i + 3]; //it's still RGBA so we can handily do this in nice chunks'o'4
}
}
if (overMaskPx > 0) {
// https://stackoverflow.com/a/30204783 ???? !!!!!!!!
overMaskCanvasCtx.fillStyle = "black";
overMaskCanvasCtx.fillRect(0, 0, drawIt.w, drawIt.h); // fill with black instead of null to start
@ -658,7 +659,7 @@ function mouseUp(evt) {
overMaskCanvasCtx.arc(
(i / 4) % overMaskCanvas.width,
Math.floor(i / 4 / overMaskCanvas.width),
4 * scaleFactor + rando,
scaleFactor + rando, // was 4 * sf + rando, too big
0,
2 * Math.PI,
true
@ -674,6 +675,7 @@ function mouseUp(evt) {
overMaskCanvas.height
);
overMaskCanvasCtx.putImageData(overMaskImgData, 0, 0);
}
// also check for painted masks in region, add them as white pixels to mask canvas
const maskChunk = maskPaintCtx.getImageData(
drawIt.x,