engine_components
engine_components copied to clipboard
[SimpleGrid] Visibility property setter does not update its own value
Describe the bug π
What happened?
When I set the grid.visible property as false the grid disappears in my UI but the property does not update its own value.
This is the code of my angular component
The setup method
this.grid = this.grids.create(this.world);
My toggle method
toggleGrid() {
if (this.grid) {
this.grid.visible = !this.grid.visible;
}
}
When I log in the console the value it prints always true, also when the grid is not visible in the UI... Probably the setter works properly to hide the grid in the UI but not to update its own value.
https://github.com/ThatOpen/engine_components/blob/main/packages/core/src/core/Grids/src/simple-grid.ts Below the code of the library
/** {@link Hideable.visible} */
set visible(visible: boolean) {
if (visible) {
const scene = this.world.scene.three;
scene.add(this.three);
} else {
this.three.removeFromParent();
}
}
Version
^2.2.0
Reproduction βΆοΈ
No response
Steps to reproduce π’
No response
System Info π»
Microsoft Edge for Business
Scopri di piΓΉ su Microsoft Edge for Business
Versione 128.0.2739.67 (Build ufficiale) (64 bit)
Used Package Manager π¦
npm
Error Trace/Logs π
No response
Validations β
- [X] Read the docs.
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [X] Make sure this is a repository issue and not a framework-specific issue. For example, if it's a THREE.js related bug, it should likely be reported to mrdoob/threejs instead.
- [X] Check that this is a concrete bug. For Q&A join our Community.
- [X] The provided reproduction is a minimal reproducible example of the bug.