Skip to content

Commit 0f1967c

Browse files
committed
fix lint errors in joist, phetsims/chipper#736
1 parent fa65cb1 commit 0f1967c

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

js/Profiler.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ define( function( require ) {
3333
// modules
3434
var inherit = require( 'PHET_CORE/inherit' );
3535
var joist = require( 'JOIST/joist' );
36+
var Util = require( 'DOT/Util' );
37+
3638

3739
// constants
3840
var FIELD_SEPARATOR = ' \u2014 '; // em dash, a long horizontal dash
@@ -81,11 +83,11 @@ define( function( require ) {
8183
}
8284

8385
// FPS
84-
var averageFPS = Math.round( 1000 / (totalTime / this.allTimes.length) );
86+
var averageFPS = Util.roundSymmetric( 1000 / (totalTime / this.allTimes.length) );
8587
var text = '' + averageFPS + ' FPS';
8688

8789
// ms/frame
88-
var averageFrameTime = Math.round( totalTime / this.allTimes.length );
90+
var averageFrameTime = Util.roundSymmetric( totalTime / this.allTimes.length );
8991
text = text + FIELD_SEPARATOR + averageFrameTime + 'ms/frame';
9092

9193
// histogram

js/splash.js

+4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// Copyright 2016-2018, University of Colorado Boulder
2+
/* eslint-disable bad-sim-text */
23

34
/**
45
* Shows the splash screen and loading progress bar.
@@ -42,6 +43,7 @@
4243

4344
var scale = Math.min( scaleX, scaleY ) * SCALE_FACTOR;
4445

46+
// use Math.round because this is a preload
4547
var translationX = Math.round( ( availableWidth - currentWidth * scale ) / 2 );
4648
var translationY = Math.round( ( availableHeight - currentHeight * scale ) * POSITION_Y );
4749

@@ -127,6 +129,8 @@
127129

128130
// fade/glow the background of the loading bar
129131
var phetSplashScreenAnimationInterval = setInterval( function() {
132+
133+
// use browser toFixed because this is a preload
130134
progressBarBackground.style[ 'stroke-width' ] = ( Math.sin( Date.now() / 1000 * 4 ) * 0.55 + 1 ).toFixed( 2 );
131135
}, 16 );
132136

0 commit comments

Comments
 (0)