Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
resize() {
if (this.container) {
this.size = SizeHelper.getSize(this.container);
this.render(true);
if (this.statRenderer) {
this.statRenderer.resize();
}
}
}publicAPI.resize = () => {
if (model.container) {
const { clientWidth, clientHeight } = sizeHelper.getSize(model.container);
publicAPI.setSize(clientWidth, clientHeight);
}
};this.container = null;
this.mouseHandler = null;
this.size = null;
if (this.statRenderer) {
this.statRenderer.setContainer(null);
}
}
if (container && this.container !== container) {
this.container = container;
this.mouseHandler = new MouseHandler(container);
this.mouseHandler.attach(this.mouseListener.getListeners());
this.container.appendChild(this.canvas);
this.size = SizeHelper.getSize(container);
if (this.statRenderer) {
this.container.appendChild(this.statContainer);
this.statRenderer.setContainer(this.statContainer);
}
this.render(true);
}
}