Skip to content

Commit

Permalink
Merge 46b9ffd into 61eb9aa
Browse files Browse the repository at this point in the history
  • Loading branch information
BarbourSmith committed Oct 3, 2019
2 parents 61eb9aa + 46b9ffd commit ee13c18
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/js/molecules/molecule.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,24 @@ export default class Molecule extends Atom{
GlobalVariables.circleSegmentSize = this.value

}

rangeElement.addEventListener('mouseup', () => {
GlobalVariables.topLevelMolecule.refreshCircles()
})
}

/**
* Used to trigger all of the circle atoms within a molecule and all of the molecules within it to update their value. Used when the number of segments changes.
*/
refreshCircles(){
this.nodesOnTheScreen.forEach(atom => {
if(atom.atomType == "Circle"){
atom.updateValue()
}
else if(atom.atomType == "Molecule" || atom.atomType == "GitHubMolecule"){
atom.refreshCircles()
}
})
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/js/prototypes/atom.js
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,7 @@ export default class Atom {
//Set the output nodes with name 'geometry' to be the generated code
if(this.output){
this.output.ready = true
this.output.lock() //This sends a chain command through the tree to lock all the inputs which are down stream of this one. This prevents
this.output.setValue(this.value)
}
}
Expand Down

0 comments on commit ee13c18

Please sign in to comment.