Skip to content

Commit

Permalink
fix bad-sim-text for scenery-phet, phetsims/chipper#736
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Jan 18, 2019
1 parent 058387f commit d69a377
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion js/LightRaysNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ define( function( require ) {
var maxRayLength = this.lightRaysNodeOptions.maxRayLength;

// number of rays is a function of brightness
var numberOfRays = ( brightness === 0 ) ? 0 : minRays + Math.round( brightness * ( maxRays - minRays ) );
var numberOfRays = ( brightness === 0 ) ? 0 : minRays + Util.roundSymmetric( brightness * ( maxRays - minRays ) );

// ray length is a function of brightness
var rayLength = minRayLength + ( brightness * ( maxRayLength - minRayLength ) );
Expand Down
6 changes: 3 additions & 3 deletions js/VisibleColor.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,9 @@ define( function( require ) {
else {
intensity = 1;
}
var red = Math.round( 255 * ( intensity * r ) );
var green = Math.round( 255 * ( intensity * g ) );
var blue = Math.round( 255 * ( intensity * b ) );
var red = Util.roundSymmetric( 255 * ( intensity * r ) );
var green = Util.roundSymmetric( 255 * ( intensity * g ) );
var blue = Util.roundSymmetric( 255 * ( intensity * b ) );
var alpha = 1;

// Add the color to the lookup array.
Expand Down
3 changes: 2 additions & 1 deletion js/demo/SlidersScreenView.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ define( function( require ) {
var VBox = require( 'SCENERY/nodes/VBox' );
var VisibleColor = require( 'SCENERY_PHET/VisibleColor' );
var WavelengthSlider = require( 'SCENERY_PHET/WavelengthSlider' );
var Util = require( 'DOT/Util' );

/**
* @constructor
Expand Down Expand Up @@ -133,7 +134,7 @@ define( function( require ) {
var demoSpectrumSlider = function( layoutBounds ) {
return new SpectrumSlider( new Property( 0.5 ), {
center: layoutBounds.center,
valueToString: function( value ) {return value.toFixed( 2 );}
valueToString: function( value ) {return Util.toFixed( value, 2 );}
} );
};

Expand Down

0 comments on commit d69a377

Please sign in to comment.