Commit 0f1967c 1 parent fa65cb1 commit 0f1967c Copy full SHA for 0f1967c
File tree 2 files changed +8
-2
lines changed
2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,8 @@ define( function( require ) {
33
33
// modules
34
34
var inherit = require ( 'PHET_CORE/inherit' ) ;
35
35
var joist = require ( 'JOIST/joist' ) ;
36
+ var Util = require ( 'DOT/Util' ) ;
37
+
36
38
37
39
// constants
38
40
var FIELD_SEPARATOR = ' \u2014 ' ; // em dash, a long horizontal dash
@@ -81,11 +83,11 @@ define( function( require ) {
81
83
}
82
84
83
85
// FPS
84
- var averageFPS = Math . round ( 1000 / ( totalTime / this . allTimes . length ) ) ;
86
+ var averageFPS = Util . roundSymmetric ( 1000 / ( totalTime / this . allTimes . length ) ) ;
85
87
var text = '' + averageFPS + ' FPS' ;
86
88
87
89
// ms/frame
88
- var averageFrameTime = Math . round ( totalTime / this . allTimes . length ) ;
90
+ var averageFrameTime = Util . roundSymmetric ( totalTime / this . allTimes . length ) ;
89
91
text = text + FIELD_SEPARATOR + averageFrameTime + 'ms/frame' ;
90
92
91
93
// histogram
Original file line number Diff line number Diff line change 1
1
// Copyright 2016-2018, University of Colorado Boulder
2
+ /* eslint-disable bad-sim-text */
2
3
3
4
/**
4
5
* Shows the splash screen and loading progress bar.
42
43
43
44
var scale = Math . min ( scaleX , scaleY ) * SCALE_FACTOR ;
44
45
46
+ // use Math.round because this is a preload
45
47
var translationX = Math . round ( ( availableWidth - currentWidth * scale ) / 2 ) ;
46
48
var translationY = Math . round ( ( availableHeight - currentHeight * scale ) * POSITION_Y ) ;
47
49
127
129
128
130
// fade/glow the background of the loading bar
129
131
var phetSplashScreenAnimationInterval = setInterval ( function ( ) {
132
+
133
+ // use browser toFixed because this is a preload
130
134
progressBarBackground . style [ 'stroke-width' ] = ( Math . sin ( Date . now ( ) / 1000 * 4 ) * 0.55 + 1 ) . toFixed ( 2 ) ;
131
135
} , 16 ) ;
132
136
You can’t perform that action at this time.
0 commit comments