@esotericsoftware/spine-webgl 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/WebGL.d.ts +5 -2
- package/dist/WebGL.js +15 -10
- package/dist/esm/spine-webgl.min.mjs +1 -1
- package/dist/esm/spine-webgl.mjs +13 -8
- package/dist/esm/spine-webgl.mjs.map +2 -2
- package/dist/iife/spine-webgl.js +13 -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
|
@@ -11475,19 +11475,24 @@ var spine = (() => {
|
|
|
11475
11475
|
let canvas = canvasOrContext;
|
|
11476
11476
|
this.gl = canvas.getContext("webgl2", contextConfig) || canvas.getContext("webgl", contextConfig);
|
|
11477
11477
|
this.canvas = canvas;
|
|
11478
|
-
canvas.addEventListener("webglcontextlost",
|
|
11479
|
-
|
|
11480
|
-
if (e) e.preventDefault();
|
|
11481
|
-
});
|
|
11482
|
-
canvas.addEventListener("webglcontextrestored", (e) => {
|
|
11483
|
-
for (let i = 0, n = this.restorables.length; i < n; i++)
|
|
11484
|
-
this.restorables[i].restore();
|
|
11485
|
-
});
|
|
11478
|
+
canvas.addEventListener("webglcontextlost", this.contextLostHandler);
|
|
11479
|
+
canvas.addEventListener("webglcontextrestored", this.contextRestoredHandler);
|
|
11486
11480
|
} else {
|
|
11487
11481
|
this.gl = canvasOrContext;
|
|
11488
11482
|
this.canvas = this.gl.canvas;
|
|
11489
11483
|
}
|
|
11490
11484
|
}
|
|
11485
|
+
contextLostHandler(e) {
|
|
11486
|
+
if (e) e.preventDefault();
|
|
11487
|
+
}
|
|
11488
|
+
contextRestoredHandler(e) {
|
|
11489
|
+
for (let i = 0, n = this.restorables.length; i < n; i++)
|
|
11490
|
+
this.restorables[i].restore();
|
|
11491
|
+
}
|
|
11492
|
+
dispose() {
|
|
11493
|
+
this.canvas.removeEventListener("webglcontextlost", this.contextLostHandler);
|
|
11494
|
+
this.canvas.removeEventListener("webglcontextrestored", this.contextRestoredHandler);
|
|
11495
|
+
}
|
|
11491
11496
|
addRestorable(restorable) {
|
|
11492
11497
|
this.restorables.push(restorable);
|
|
11493
11498
|
}
|