Skip to content

Commit

Permalink
Math.round() and js tofixed was used changing it to use dot.util func…
Browse files Browse the repository at this point in the history
…tions, see issue #48
  • Loading branch information
aadish committed Mar 15, 2016
1 parent c7e89c5 commit fe5dd3d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions js/gravity-force-lab/view/MassNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ define( function( require ) {
var SimpleDragHandler = require( 'SCENERY/input/SimpleDragHandler' );
var StringUtils = require( 'PHETCOMMON/util/StringUtils' );
var Text = require( 'SCENERY/nodes/Text' );
var Util = require( 'DOT/Util' );

// strings
var forceDescriptionPatternTargetSourceString = require( 'string!GRAVITY_FORCE_LAB/force-description-pattern-target_source' );
Expand Down Expand Up @@ -136,7 +137,7 @@ define( function( require ) {
//self.massCircle.scale( massModel.radius );

if ( model.showValues ) {
var forceStr = model.force.toFixed( 12 );
var forceStr = Util.toFixed( model.force, 12 );
forceStr = ( forceStr.substr( 0, 5 ) + ' ' + forceStr.substr( 5, 3 ) + ' ' + forceStr.substr( 8, 3 ) + ' ' + forceStr.substr( 11, 3 ) );
arrowText.text = StringUtils.format( forceDescriptionPatternTargetSourceValueString, options.label, options.otherMassLabel, forceStr );
}
Expand Down Expand Up @@ -164,7 +165,7 @@ define( function( require ) {
stroke: null
} );
thisNode.addChild( arrowNode );
self.pullerNode.setPull( Math.round( forceToImage( model.force ) ), (self.massCircle.width / 2) );
self.pullerNode.setPull( Util.roundSymmetric( forceToImage( model.force ) ), (self.massCircle.width / 2) );
};

massModel.positionProperty.link( function( prop ) {
Expand Down

0 comments on commit fe5dd3d

Please sign in to comment.