From f9af08ce5ae634ea5d62a80adbce37dacc75f206 Mon Sep 17 00:00:00 2001 From: Jonathan Olson Date: Tue, 23 Jun 2015 14:18:00 -0600 Subject: [PATCH] Math.round => Util.roundSymmetric, see https://github.com/phetsims/tasks/issues/275 --- js/common/view/FrictionSliderNode.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/js/common/view/FrictionSliderNode.js b/js/common/view/FrictionSliderNode.js index 3efd357..48336ef 100644 --- a/js/common/view/FrictionSliderNode.js +++ b/js/common/view/FrictionSliderNode.js @@ -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 @@ -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 ); } /** @@ -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 ) ); } ); }