Skip to content

Commit

Permalink
update: clear bonds group before creating new
Browse files Browse the repository at this point in the history
  • Loading branch information
VsevolodX committed Dec 15, 2023
1 parent b701029 commit 7488e9d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/mixins/bonds.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const BondsMixin = (superclass) =>
class extends superclass {
constructor(config) {
super(config);
this.bondsGroup = new THREE.Group();
this.createBondsAsync();
this.isDrawBondsEnabled = false;
this.drawBonds = this.drawBonds.bind(this);
Expand All @@ -27,6 +28,7 @@ export const BondsMixin = (superclass) =>
const clsInstance = this;
clsInstance.areBondsCreated = false;
setTimeout(() => {
clsInstance.bondsGroup.clear();
clsInstance.bondsGroup = clsInstance.createBondsGroup();
clsInstance.areBondsCreated = true;
}, 10);
Expand Down

0 comments on commit 7488e9d

Please sign in to comment.