Skip to content

Commit

Permalink
fix: fix issue with old scene mask not being cleared on scene change
Browse files Browse the repository at this point in the history
  • Loading branch information
ghost91- committed Nov 12, 2022
1 parent c4cbffc commit cd875dc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/particle-effects/scene-mask.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ export function registerSceneMaskFunctionality() {

function drawSceneMask() {
const msk = canvas.masks.depth;
if (msk.fxmasterSceneMask) {
msk.removeChild(msk.fxmasterSceneMask);
delete msk.fxmasterSceneMask;
}
if (shouldMaskToScene()) {
const mask = new PIXI.LegacyGraphics()
.beginFill(0x0000ff)
Expand All @@ -15,9 +19,6 @@ function drawSceneMask() {
mask.mask = new PIXI.MaskData();
mask.mask.colorMask = PIXI.COLOR_MASK_BITS.BLUE;
msk.fxmasterSceneMask = msk.addChild(mask);
} else if (msk.fxmasterSceneMask) {
msk.removeChild(msk.fxmasterSceneMask);
delete msk.fxmasterSceneMask;
}
}

Expand Down

0 comments on commit cd875dc

Please sign in to comment.