Skip to content

Commit

Permalink
Updated vars, see #64
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Feb 14, 2018
1 parent 1a7e87d commit 33bf76d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions js/friction/view/magnifier/AtomCanvasNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ define( function( require ) {
0,
PARTICLE_IMAGE_SIZE,
PARTICLE_IMAGE_SIZE,
atomNode.currentX - particleImageSize / 2,
atomNode.currentY - particleImageSize / 2,
atomNode.positionX - particleImageSize / 2,
atomNode.positionY - particleImageSize / 2,
particleImageSize,
particleImageSize
);
Expand Down
17 changes: 9 additions & 8 deletions js/friction/view/magnifier/AtomNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,17 @@ define( function( require ) {
var self = this;
var radius = model.atoms.radius;

// TODO: mark these variables with visibility annotations
// flag records whether we are on the top book
// @public (read-only) {boolean} flag records whether we are on the top book
this.isTopAtom = options.color === FrictionConstants.TOP_BOOK_ATOMS_COLOR;

// TODO: visibility annotation and docs
// @private - marked as true when the atom is evaporated
this.isEvaporated = false;

// TODO: visibility annotation and docs
this.currentX = 0;
this.currentY = 0;
// @public {number} - the x-position of the AtomNode
this.positionX = 0;

// @public {number} - the y-position of the AtomNode
this.positionY = 0;

// TODO: visibility annotation and docs
this.x0 = options.x; // TODO: is this variable used elsewhere? Does it need a better name?
Expand Down Expand Up @@ -96,8 +97,8 @@ define( function( require ) {

// update atom's position based on vibration and center position
model.stepEmitter.addListener( function() {
self.currentX = self.x0 + model.amplitudeProperty.get() * ( phet.joist.random.nextDouble() - 0.5 );
self.currentY = self.y0 + model.amplitudeProperty.get() * ( phet.joist.random.nextDouble() - 0.5 );
self.positionX = self.x0 + model.amplitudeProperty.get() * ( phet.joist.random.nextDouble() - 0.5 );
self.positionY = self.y0 + model.amplitudeProperty.get() * ( phet.joist.random.nextDouble() - 0.5 );
} );
}

Expand Down

0 comments on commit 33bf76d

Please sign in to comment.