forked from ppfun/pixelplanet
add makenull CanvasCleaner strategy
This commit is contained in:
parent
51ef4a52cd
commit
f2de50f846
|
@ -191,6 +191,9 @@ function ModCanvastools() {
|
|||
// eslint-disable-next-line max-len
|
||||
descCleanAction = t`Clean spare pixels that are surrounded by a single other color or unset pixels (VERY AGGRESSIVE ON CANVASES THAT ALLOW UNSET PIXELS (where there are two cooldowns)!)`;
|
||||
break;
|
||||
case 'makenull':
|
||||
// eslint-disable-next-line max-len
|
||||
descCleanAction = t`Turn every pixel in area to 0 (YOU REALLY SHOULDN'T DO THAT ON ANY AREA THAT ISN'T ALREADY MOSTLY 0)`;
|
||||
default:
|
||||
// nothing
|
||||
}
|
||||
|
@ -496,7 +499,7 @@ function ModCanvastools() {
|
|||
selectCleanAction(sel.options[sel.selectedIndex].value);
|
||||
}}
|
||||
>
|
||||
{['spare', 'spareext', 'spareextu'].map((opt) => (
|
||||
{['spare', 'spareext', 'spareextu', 'makenull'].map((opt) => (
|
||||
<option
|
||||
key={opt}
|
||||
value={opt}
|
||||
|
|
|
@ -120,6 +120,14 @@ const METHODS = {
|
|||
}
|
||||
return finPxl;
|
||||
},
|
||||
|
||||
makenull: (xc, yc, clrIgnore, canvasCleaner) => {
|
||||
let pxl = canvasCleaner.getPixelInChunkArea(xc, yc);
|
||||
if (pxl === null || pxl === 0) {
|
||||
return null;
|
||||
}
|
||||
return 0;
|
||||
},
|
||||
};
|
||||
|
||||
class CanvasCleaner {
|
||||
|
|
Loading…
Reference in New Issue
Block a user