Allow renderer to be swapped in and out at runtime

Fixes #1589
This commit is contained in:
Daniel Imms
2018-07-29 13:50:45 -07:00
parent 6691f80906
commit 5aaf9ef11b
7 changed files with 62 additions and 12 deletions
+5
View File
@@ -76,6 +76,11 @@ export class Renderer extends EventEmitter implements IRenderer {
}
}
public dispose(): void {
super.dispose();
this._renderLayers.forEach(l => l.dispose());
}
public onIntersectionChange(entry: IntersectionObserverEntry): void {
this._isPaused = entry.intersectionRatio === 0;
if (!this._isPaused && this._needsFullRefresh) {