Skip to content

Commit

Permalink
added tandem for ArrowNode, see #76, also fixed an issue where the ar…
Browse files Browse the repository at this point in the history
…row node was being removed and added back on each redraw instead of just resized
  • Loading branch information
jbphet committed Nov 29, 2016
1 parent 387fd8c commit 2d00eae
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions js/gravity-force-lab/view/MassNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,11 @@ define( function( require ) {
this.y = options.y;

var arrowNode = new ArrowNode( 0, -options.forceArrowHeight, 200, -options.forceArrowHeight, {
headHeight: 10,
headWidth: 10,
headHeight: 8,
headWidth: 8,
tailWidth: 3,
stroke: null
stroke: null,
tandem: tandem.createTandem( 'arrowNode' )
} );
var arrowText = new Text( options.title ? options.title : '', {
font: new PhetFont( 16 ),
Expand Down Expand Up @@ -175,14 +176,13 @@ define( function( require ) {
arrowLengthMultiplier *= -1;
}

self.removeChild( arrowNode );
arrowNode = new ArrowNode( 0, -options.forceArrowHeight, arrowLengthMultiplier * ARROW_LENGTH, -options.forceArrowHeight, {
headHeight: 8,
headWidth: 8,
tailWidth: 3,
stroke: null
} );
self.addChild( arrowNode );
arrowNode.setTailAndTip(
0,
-options.forceArrowHeight,
arrowLengthMultiplier * ARROW_LENGTH,
-options.forceArrowHeight
);

self.pullerNode.setPull( Util.roundSymmetric( forceToImage( model.forceProperty.get() ) ), (self.massCircle.width / 2) );
};

Expand Down

0 comments on commit 2d00eae

Please sign in to comment.