Update references to the old skin

This commit is contained in:
DD
2017-08-31 17:04:05 -04:00
parent fa12b523c9
commit 553af92910

View File

@@ -239,6 +239,13 @@ class RenderWebGL extends EventEmitter {
newSkin.setSVG(svgData, rotationCenter);
const oldSkin = this._allSkins[skinId];
this._allSkins[skinId] = newSkin;
// Tell drawables to update
for (const drawable of this._allDrawables) {
if (drawable && drawable.skin === oldSkin) {
drawable.skin = newSkin;
}
}
oldSkin.dispose();
}