Skip to content
Snippets Groups Projects
Commit 3983073d authored by David Sehnal's avatar David Sehnal
Browse files

mol-plugin: fix canvas bg color when setting partial renderer params

parent 82b22fa3
No related branches found
No related tags found
No related merge requests found
......@@ -190,7 +190,13 @@ export class PluginContext {
const antialias = !(this.config.get(PluginConfig.General.DisableAntialiasing) ?? false);
(this.canvas3d as Canvas3D) = Canvas3D.fromCanvas(canvas, {}, { antialias });
this.canvas3dInit.next(true);
this.canvas3d?.setProps(this.spec.components?.viewport?.canvas3d || { renderer: { backgroundColor: Color(0xFCFBF9) } });
const props = this.spec.components?.viewport?.canvas3d;
if (!props || props.renderer?.backgroundColor === void 0) {
this.canvas3d?.setProps({ renderer: { backgroundColor: Color(0xFCFBF9) } });
}
if (props) {
this.canvas3d?.setProps(props);
}
this.canvas3d!.animate();
(this.helpers.viewportScreenshot as ViewportScreenshotHelper) = new ViewportScreenshotHelper(this);
return true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment