Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: volume dynamic object behavior #164

Merged
merged 2 commits into from
Apr 11, 2024
Merged

Conversation

Keelaro1
Copy link
Contributor

No description provided.

// check if the volumes dynamic object is already added
const position = this.dynamicObjectsComponent.model.getObjectPosition(this.volumesModel.id);
if (position !== -1) {
if (position === -1) {
this.dynamicObjectsComponent.model.addObject(this.volumesDynamicObject);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it is better for code reading to restore an object destructure? Because it is difficult to track where paneId is changed.

Or we can make a setter before adding object to this.dynamicObjectsComponent.model and after that use this.volumesDynamicObject

But, if this.config.components.volumes.visible === false, we delete it from this.dynamicObjectsComponent.model, but we still have this.volumesDynamicObject in memory.
In general, looks like it is unnecessarily to keep it in this class, and use getter/setter for it

@KirillBobkov KirillBobkov merged commit 4af745d into master Apr 11, 2024
2 checks passed
@Keelaro1 Keelaro1 deleted the fix-volume-dynamic-object branch April 18, 2024 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants