Skip to content

Commit

Permalink
fix loop
Browse files Browse the repository at this point in the history
  • Loading branch information
Zyie committed Apr 4, 2024
1 parent 5ac64c6 commit 387e159
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
14 changes: 13 additions & 1 deletion packages/api/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ declare global {
__PIXI_DEVTOOLS_WRAPPER__: any;
__PIXI_DEVTOOLS__: {
pixi: typeof import('pixi.js');
app: import('pixi.js').Application | undefined;
app?: import('pixi.js').Application | undefined;
stage?: import('pixi.js').Container | undefined;
renderer?: import('pixi.js').Renderer | undefined;
plugins?: {
Expand All @@ -17,6 +17,18 @@ declare global {
};
};
}

namespace PixiMixins {
interface Container {
__devtoolIgnore?: boolean;
}
}

namespace GlobalMixins {
interface Container {
__devtoolIgnore?: boolean;
}
}
}

export {};
1 change: 0 additions & 1 deletion packages/devtool-chrome/src/inject/pixi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ class PixiWrapper {
},
test: (container) => {
if(container.__devtoolIgnore) return false;
if(container instanceof this.pixi.ParticleContainer) return false;
return true;
},
});
Expand Down
4 changes: 2 additions & 2 deletions packages/devtool-chrome/src/inject/utils/loop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Container } from 'pixi.js';

interface LoopOptions {
loop: (container: Container, parent: Container) => void;
test: (container: Container, parent: Container) => boolean;
test?: (container: Container, parent: Container) => boolean;
container: Container;
}

Expand All @@ -15,7 +15,7 @@ export function loop(options: LoopOptions) {
function loopRecursive(container: Container, opts: Omit<LoopOptions, 'container'>) {
const { loop, test } = opts;

if (!test(container, container.parent)) {
if (!test?.(container, container.parent)) {
return;
}

Expand Down

0 comments on commit 387e159

Please sign in to comment.