From 0f1967cb35b7ac9e8337b92d59ea204b3b5fdd9d Mon Sep 17 00:00:00 2001 From: zepumph Date: Thu, 17 Jan 2019 15:29:09 -0900 Subject: [PATCH] fix lint errors in joist, https://github.com/phetsims/chipper/issues/736 --- js/Profiler.js | 6 ++++-- js/splash.js | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/js/Profiler.js b/js/Profiler.js index 55484e8e..738f23ed 100644 --- a/js/Profiler.js +++ b/js/Profiler.js @@ -33,6 +33,8 @@ define( function( require ) { // modules var inherit = require( 'PHET_CORE/inherit' ); var joist = require( 'JOIST/joist' ); + var Util = require( 'DOT/Util' ); + // constants var FIELD_SEPARATOR = ' \u2014 '; // em dash, a long horizontal dash @@ -81,11 +83,11 @@ define( function( require ) { } // FPS - var averageFPS = Math.round( 1000 / (totalTime / this.allTimes.length) ); + var averageFPS = Util.roundSymmetric( 1000 / (totalTime / this.allTimes.length) ); var text = '' + averageFPS + ' FPS'; // ms/frame - var averageFrameTime = Math.round( totalTime / this.allTimes.length ); + var averageFrameTime = Util.roundSymmetric( totalTime / this.allTimes.length ); text = text + FIELD_SEPARATOR + averageFrameTime + 'ms/frame'; // histogram diff --git a/js/splash.js b/js/splash.js index 51e63141..a35a7ffb 100644 --- a/js/splash.js +++ b/js/splash.js @@ -1,4 +1,5 @@ // Copyright 2016-2018, University of Colorado Boulder +/* eslint-disable bad-sim-text */ /** * Shows the splash screen and loading progress bar. @@ -42,6 +43,7 @@ var scale = Math.min( scaleX, scaleY ) * SCALE_FACTOR; + // use Math.round because this is a preload var translationX = Math.round( ( availableWidth - currentWidth * scale ) / 2 ); var translationY = Math.round( ( availableHeight - currentHeight * scale ) * POSITION_Y ); @@ -127,6 +129,8 @@ // fade/glow the background of the loading bar var phetSplashScreenAnimationInterval = setInterval( function() { + + // use browser toFixed because this is a preload progressBarBackground.style[ 'stroke-width' ] = ( Math.sin( Date.now() / 1000 * 4 ) * 0.55 + 1 ).toFixed( 2 ); }, 16 );