@esotericsoftware/spine-phaser-v3 4.2.92 → 4.2.93
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/spine-phaser-v3.min.mjs +1 -1
- package/dist/esm/spine-phaser-v3.mjs +8 -8
- package/dist/esm/spine-phaser-v3.mjs.map +2 -2
- package/dist/iife/spine-phaser-v3.js +8 -8
- package/dist/iife/spine-phaser-v3.js.map +2 -2
- package/dist/iife/spine-phaser-v3.min.js +1 -1
- package/package.json +4 -4
|
@@ -11760,10 +11760,10 @@ var spine = (() => {
|
|
|
11760
11760
|
var ManagedWebGLRenderingContext = class {
|
|
11761
11761
|
canvas;
|
|
11762
11762
|
gl;
|
|
11763
|
-
restorables =
|
|
11764
|
-
constructor(canvasOrContext, contextConfig = { alpha:
|
|
11763
|
+
restorables = [];
|
|
11764
|
+
constructor(canvasOrContext, contextConfig = { alpha: true }) {
|
|
11765
11765
|
if (!(canvasOrContext instanceof WebGLRenderingContext || typeof WebGL2RenderingContext !== "undefined" && canvasOrContext instanceof WebGL2RenderingContext)) {
|
|
11766
|
-
|
|
11766
|
+
const canvas = canvasOrContext;
|
|
11767
11767
|
this.gl = canvas.getContext("webgl2", contextConfig) || canvas.getContext("webgl", contextConfig);
|
|
11768
11768
|
this.canvas = canvas;
|
|
11769
11769
|
canvas.addEventListener("webglcontextlost", this.contextLostHandler);
|
|
@@ -11773,13 +11773,13 @@ var spine = (() => {
|
|
|
11773
11773
|
this.canvas = this.gl.canvas;
|
|
11774
11774
|
}
|
|
11775
11775
|
}
|
|
11776
|
-
contextLostHandler(e) {
|
|
11776
|
+
contextLostHandler = (e) => {
|
|
11777
11777
|
if (e) e.preventDefault();
|
|
11778
|
-
}
|
|
11779
|
-
contextRestoredHandler(
|
|
11778
|
+
};
|
|
11779
|
+
contextRestoredHandler = () => {
|
|
11780
11780
|
for (let i = 0, n = this.restorables.length; i < n; i++)
|
|
11781
11781
|
this.restorables[i].restore();
|
|
11782
|
-
}
|
|
11782
|
+
};
|
|
11783
11783
|
dispose() {
|
|
11784
11784
|
this.canvas.removeEventListener("webglcontextlost", this.contextLostHandler);
|
|
11785
11785
|
this.canvas.removeEventListener("webglcontextrestored", this.contextRestoredHandler);
|
|
@@ -11788,7 +11788,7 @@ var spine = (() => {
|
|
|
11788
11788
|
this.restorables.push(restorable);
|
|
11789
11789
|
}
|
|
11790
11790
|
removeRestorable(restorable) {
|
|
11791
|
-
|
|
11791
|
+
const index = this.restorables.indexOf(restorable);
|
|
11792
11792
|
if (index > -1) this.restorables.splice(index, 1);
|
|
11793
11793
|
}
|
|
11794
11794
|
};
|