@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/esm/spine-webgl.mjs
CHANGED
|
@@ -11284,10 +11284,10 @@ function getValue(map, property, defaultValue) {
|
|
|
11284
11284
|
var ManagedWebGLRenderingContext = class {
|
|
11285
11285
|
canvas;
|
|
11286
11286
|
gl;
|
|
11287
|
-
restorables =
|
|
11288
|
-
constructor(canvasOrContext, contextConfig = { alpha:
|
|
11287
|
+
restorables = [];
|
|
11288
|
+
constructor(canvasOrContext, contextConfig = { alpha: true }) {
|
|
11289
11289
|
if (!(canvasOrContext instanceof WebGLRenderingContext || typeof WebGL2RenderingContext !== "undefined" && canvasOrContext instanceof WebGL2RenderingContext)) {
|
|
11290
|
-
|
|
11290
|
+
const canvas = canvasOrContext;
|
|
11291
11291
|
this.gl = canvas.getContext("webgl2", contextConfig) || canvas.getContext("webgl", contextConfig);
|
|
11292
11292
|
this.canvas = canvas;
|
|
11293
11293
|
canvas.addEventListener("webglcontextlost", this.contextLostHandler);
|
|
@@ -11297,13 +11297,13 @@ var ManagedWebGLRenderingContext = class {
|
|
|
11297
11297
|
this.canvas = this.gl.canvas;
|
|
11298
11298
|
}
|
|
11299
11299
|
}
|
|
11300
|
-
contextLostHandler(e) {
|
|
11300
|
+
contextLostHandler = (e) => {
|
|
11301
11301
|
if (e) e.preventDefault();
|
|
11302
|
-
}
|
|
11303
|
-
contextRestoredHandler(
|
|
11302
|
+
};
|
|
11303
|
+
contextRestoredHandler = () => {
|
|
11304
11304
|
for (let i = 0, n = this.restorables.length; i < n; i++)
|
|
11305
11305
|
this.restorables[i].restore();
|
|
11306
|
-
}
|
|
11306
|
+
};
|
|
11307
11307
|
dispose() {
|
|
11308
11308
|
this.canvas.removeEventListener("webglcontextlost", this.contextLostHandler);
|
|
11309
11309
|
this.canvas.removeEventListener("webglcontextrestored", this.contextRestoredHandler);
|
|
@@ -11312,7 +11312,7 @@ var ManagedWebGLRenderingContext = class {
|
|
|
11312
11312
|
this.restorables.push(restorable);
|
|
11313
11313
|
}
|
|
11314
11314
|
removeRestorable(restorable) {
|
|
11315
|
-
|
|
11315
|
+
const index = this.restorables.indexOf(restorable);
|
|
11316
11316
|
if (index > -1) this.restorables.splice(index, 1);
|
|
11317
11317
|
}
|
|
11318
11318
|
};
|