Fix: problème de contexte WebGL
WARNING: Too many active WebGL contexts. Oldest context will be lost. Semble lié à la destruction incorrecte de l'Application PIXI des TMR, en cas de nombreuses ouvertures/fermetures
This commit is contained in:
@ -26,6 +26,7 @@ export class PixiTMR {
|
||||
this.tmrDialog = tmrDialog;
|
||||
this.callbacksOnAnimate = [];
|
||||
this.sizes = new TMRConstants({ size: displaySize })
|
||||
console.info(`Creation d'Application PIXI pour les TMR de ${tmrDialog.actor.name}`)
|
||||
this.pixiApp = new PIXI.Application(PixiTMR.computeTMRSize(this.sizes));
|
||||
this.pixiApp.eventMode = 'static';
|
||||
this.pixiApp.stage.sortableChildren = true;
|
||||
@ -45,7 +46,9 @@ export class PixiTMR {
|
||||
}
|
||||
|
||||
close() {
|
||||
this.pixiApp.ticker.stop();
|
||||
console.info(`Destruction d'Application PIXI pour les TMR de ${this.tmrDialog.actor.name}`)
|
||||
this.pixiApp.destroy();
|
||||
this.pixiApp = undefined
|
||||
}
|
||||
static computeTMRSize(sizeConstants) {
|
||||
return { width: sizeConstants.cellw * 13 + sizeConstants.marginx, height: sizeConstants.cellh / 2 + sizeConstants.cellh * 15 + sizeConstants.marginy }
|
||||
|
Reference in New Issue
Block a user