diff --git a/resources/openbim-components.js b/resources/openbim-components.js index 67d8562d4..b0e7a4ce8 100644 --- a/resources/openbim-components.js +++ b/resources/openbim-components.js @@ -108684,12 +108684,7 @@ class SimpleDimensionLine { this.label.visible = value; this._endpoints[0].visible = value; this._endpoints[1].visible = value; - if (value) { - this._components.scene.get().add(this._root); - } - else { - this._root.removeFromParent(); - } + this._root.visible = value; } set endPoint(point) { this.end = point; @@ -108823,11 +108818,8 @@ class LengthMeasurement extends Component { /** {@link Hideable.visible} */ set visible(value) { this._visible = value; - if (!this._visible) { - this.enabled = false; - } for (const dimension of this._measurements) { - dimension.visible = this._visible; + dimension.visible = value; } } /** diff --git a/src/measurement/LengthMeasurement/index.ts b/src/measurement/LengthMeasurement/index.ts index 4545470cf..6143f311e 100644 --- a/src/measurement/LengthMeasurement/index.ts +++ b/src/measurement/LengthMeasurement/index.ts @@ -107,11 +107,8 @@ export class LengthMeasurement /** {@link Hideable.visible} */ set visible(value: boolean) { this._visible = value; - if (!this._visible) { - this.enabled = false; - } for (const dimension of this._measurements) { - dimension.visible = this._visible; + dimension.visible = value; } } diff --git a/src/measurement/LengthMeasurement/src/index.ts b/src/measurement/LengthMeasurement/src/index.ts index 50f0ef96b..18ffd4143 100644 --- a/src/measurement/LengthMeasurement/src/index.ts +++ b/src/measurement/LengthMeasurement/src/index.ts @@ -26,11 +26,7 @@ export class SimpleDimensionLine { this.label.visible = value; this._endpoints[0].visible = value; this._endpoints[1].visible = value; - if (value) { - this._components.scene.get().add(this._root); - } else { - this._root.removeFromParent(); - } + this._root.visible = value; } set endPoint(point: THREE.Vector3) {