Skip to content

Commit

Permalink
fix: make non inverted masks work in V9
Browse files Browse the repository at this point in the history
  • Loading branch information
ghost91- committed Dec 16, 2021
1 parent 17ca3ab commit 8b251ce
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/module/weatherEffects/WeatherLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ export class WeatherLayer extends CanvasLayer {
}

_createMask() {
const mask = new PIXI.Graphics();
// holes are broken in @pixi/[email protected] (see https://github.com/pixijs/graphics-smooth/pull/7), so we need to use the legacy graphics in V9 and above.
const Graphics = PIXI.LegacyGraphics ?? PIXI.Graphics;
const mask = new Graphics();
const sceneShape = canvas.scene.img ? canvas.dimensions.sceneRect.clone() : canvas.dimensions.rect.clone();
mask.beginFill(0x000000).drawShape(sceneShape).endFill();

Expand Down

0 comments on commit 8b251ce

Please sign in to comment.