Skip to content

Commit a45fbaf

Browse files
committed
Fix geo backround
One have to set scene background as well
1 parent b9035b8 commit a45fbaf

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

modules/geom/TGeoPainter.mjs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,8 @@ class TGeoPainter extends ObjectPainter {
11051105
changedBackground(val) {
11061106
if (val !== undefined)
11071107
this.ctrl.background = val;
1108-
this._renderer.setClearColor(this.ctrl.background, 1);
1108+
this._scene.background = new Color(this.ctrl.background);
1109+
this._renderer.setClearColor(this._scene.background, 1);
11091110
this.render3D(0);
11101111

11111112
if (this._toolbar) {
@@ -2410,6 +2411,8 @@ class TGeoPainter extends ObjectPainter {
24102411

24112412
this._scene.add(this._toplevel);
24122413

2414+
this._scene.background = new Color(this.ctrl.background);
2415+
24132416
return createRender3D(w, h, this.options.Render3D, { antialias: true, logarithmicDepthBuffer: false, preserveDrawingBuffer: true }).then(r => {
24142417

24152418
this._renderer = r;
@@ -2421,7 +2424,7 @@ class TGeoPainter extends ObjectPainter {
24212424
this._renderer.setSize(w, h, !this._fit_main_area);
24222425
this._renderer.localClippingEnabled = true;
24232426

2424-
this._renderer.setClearColor(this.ctrl.background, 1);
2427+
this._renderer.setClearColor(this._scene.background, 1);
24252428

24262429
if (this._fit_main_area && this._webgl) {
24272430
this._renderer.domElement.style.width = '100%';

0 commit comments

Comments
 (0)