@esotericsoftware/spine-phaser-v3 4.2.86 → 4.2.88
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 +3 -3
- package/dist/esm/spine-phaser-v3.mjs +13 -8
- package/dist/esm/spine-phaser-v3.mjs.map +2 -2
- package/dist/iife/spine-phaser-v3.js +13 -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
|
@@ -11309,19 +11309,24 @@ var ManagedWebGLRenderingContext = class {
|
|
|
11309
11309
|
let canvas = canvasOrContext;
|
|
11310
11310
|
this.gl = canvas.getContext("webgl2", contextConfig) || canvas.getContext("webgl", contextConfig);
|
|
11311
11311
|
this.canvas = canvas;
|
|
11312
|
-
canvas.addEventListener("webglcontextlost",
|
|
11313
|
-
|
|
11314
|
-
if (e) e.preventDefault();
|
|
11315
|
-
});
|
|
11316
|
-
canvas.addEventListener("webglcontextrestored", (e) => {
|
|
11317
|
-
for (let i = 0, n = this.restorables.length; i < n; i++)
|
|
11318
|
-
this.restorables[i].restore();
|
|
11319
|
-
});
|
|
11312
|
+
canvas.addEventListener("webglcontextlost", this.contextLostHandler);
|
|
11313
|
+
canvas.addEventListener("webglcontextrestored", this.contextRestoredHandler);
|
|
11320
11314
|
} else {
|
|
11321
11315
|
this.gl = canvasOrContext;
|
|
11322
11316
|
this.canvas = this.gl.canvas;
|
|
11323
11317
|
}
|
|
11324
11318
|
}
|
|
11319
|
+
contextLostHandler(e) {
|
|
11320
|
+
if (e) e.preventDefault();
|
|
11321
|
+
}
|
|
11322
|
+
contextRestoredHandler(e) {
|
|
11323
|
+
for (let i = 0, n = this.restorables.length; i < n; i++)
|
|
11324
|
+
this.restorables[i].restore();
|
|
11325
|
+
}
|
|
11326
|
+
dispose() {
|
|
11327
|
+
this.canvas.removeEventListener("webglcontextlost", this.contextLostHandler);
|
|
11328
|
+
this.canvas.removeEventListener("webglcontextrestored", this.contextRestoredHandler);
|
|
11329
|
+
}
|
|
11325
11330
|
addRestorable(restorable) {
|
|
11326
11331
|
this.restorables.push(restorable);
|
|
11327
11332
|
}
|