@esotericsoftware/spine-webgl 4.2.91 → 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/WebGL.d.ts +2 -2
- package/dist/WebGL.js +9 -9
- package/dist/esm/spine-webgl.min.mjs +1 -1
- package/dist/esm/spine-webgl.mjs +8 -8
- package/dist/esm/spine-webgl.mjs.map +2 -2
- package/dist/iife/spine-webgl.js +8 -8
- package/dist/iife/spine-webgl.js.map +2 -2
- package/dist/iife/spine-webgl.min.js +1 -1
- package/package.json +2 -2
package/dist/iife/spine-webgl.js
CHANGED
|
@@ -11469,10 +11469,10 @@ var spine = (() => {
|
|
|
11469
11469
|
var ManagedWebGLRenderingContext = class {
|
|
11470
11470
|
canvas;
|
|
11471
11471
|
gl;
|
|
11472
|
-
restorables =
|
|
11473
|
-
constructor(canvasOrContext, contextConfig = { alpha:
|
|
11472
|
+
restorables = [];
|
|
11473
|
+
constructor(canvasOrContext, contextConfig = { alpha: true }) {
|
|
11474
11474
|
if (!(canvasOrContext instanceof WebGLRenderingContext || typeof WebGL2RenderingContext !== "undefined" && canvasOrContext instanceof WebGL2RenderingContext)) {
|
|
11475
|
-
|
|
11475
|
+
const canvas = canvasOrContext;
|
|
11476
11476
|
this.gl = canvas.getContext("webgl2", contextConfig) || canvas.getContext("webgl", contextConfig);
|
|
11477
11477
|
this.canvas = canvas;
|
|
11478
11478
|
canvas.addEventListener("webglcontextlost", this.contextLostHandler);
|
|
@@ -11482,13 +11482,13 @@ var spine = (() => {
|
|
|
11482
11482
|
this.canvas = this.gl.canvas;
|
|
11483
11483
|
}
|
|
11484
11484
|
}
|
|
11485
|
-
contextLostHandler(e) {
|
|
11485
|
+
contextLostHandler = (e) => {
|
|
11486
11486
|
if (e) e.preventDefault();
|
|
11487
|
-
}
|
|
11488
|
-
contextRestoredHandler(
|
|
11487
|
+
};
|
|
11488
|
+
contextRestoredHandler = () => {
|
|
11489
11489
|
for (let i = 0, n = this.restorables.length; i < n; i++)
|
|
11490
11490
|
this.restorables[i].restore();
|
|
11491
|
-
}
|
|
11491
|
+
};
|
|
11492
11492
|
dispose() {
|
|
11493
11493
|
this.canvas.removeEventListener("webglcontextlost", this.contextLostHandler);
|
|
11494
11494
|
this.canvas.removeEventListener("webglcontextrestored", this.contextRestoredHandler);
|
|
@@ -11497,7 +11497,7 @@ var spine = (() => {
|
|
|
11497
11497
|
this.restorables.push(restorable);
|
|
11498
11498
|
}
|
|
11499
11499
|
removeRestorable(restorable) {
|
|
11500
|
-
|
|
11500
|
+
const index = this.restorables.indexOf(restorable);
|
|
11501
11501
|
if (index > -1) this.restorables.splice(index, 1);
|
|
11502
11502
|
}
|
|
11503
11503
|
};
|