Skip to content

Commit

Permalink
Math.round => Util.roundSymmetric, see phetsims/tasks#275
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanolson committed Jun 23, 2015
1 parent a4f3434 commit f9af08c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions js/common/view/FrictionSliderNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ define( function( require ) {
var PhetFont = require( 'SCENERY_PHET/PhetFont' );
var Property = require( 'AXON/Property' );
var Range = require( 'DOT/Range' );
var Util = require( 'DOT/Util' );
var Text = require( 'SCENERY/nodes/Text' );

// strings
Expand All @@ -30,7 +31,7 @@ define( function( require ) {
}

function frictionToSliderValue( friction ) {
return Math.round( Math.log( friction / 0.0005 + 1 ) / Math.LN2 );
return Util.roundSymmetric( Math.log( friction / 0.0005 + 1 ) / Math.LN2 );
}

/**
Expand Down Expand Up @@ -68,12 +69,12 @@ define( function( require ) {
frictionProperty.value = sliderValueToFriction( sliderValue );
}
else {
sliderValueProperty.value = Math.round( sliderValue );
sliderValueProperty.value = Util.roundSymmetric( sliderValue );
}
} );

frictionProperty.lazyLink( function( frictionValue ) {
sliderValueProperty.value = Math.round( frictionToSliderValue( frictionValue ) );
sliderValueProperty.value = Util.roundSymmetric( frictionToSliderValue( frictionValue ) );
} );
}

Expand Down

0 comments on commit f9af08c

Please sign in to comment.