Skip to content

Commit ed580ea

Browse files
committed
More fixes.
1 parent 10a0916 commit ed580ea

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Stats.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ var Stats = function () {
3333

3434
}
3535

36+
mode = id;
37+
3638
}
3739

3840
//
@@ -125,7 +127,7 @@ Stats.Panel = function ( name, fg, bg ) {
125127
context.globalAlpha = 0.9;
126128
context.fillRect( 3, 15, 74, 30 );
127129

128-
var min = Infinity, max = 0;
130+
var min = Infinity, max = 0, round = Math.round;
129131

130132
return {
131133

@@ -140,15 +142,15 @@ Stats.Panel = function ( name, fg, bg ) {
140142
context.fillStyle = bg;
141143
context.fillRect( 0, 0, 80, 15 );
142144
context.fillStyle = fg;
143-
context.fillText( ( value | 0 ) + ' ' + name + ' (' + ( min | 0 ) + '-' + ( max | 0 ) + ')', 3, 10 );
145+
context.fillText( round( value ) + ' ' + name + ' (' + round( min ) + '-' + round( max ) + ')', 3, 10 );
144146

145147
context.drawImage( canvas, 4, 15, 74, 30, 3, 15, 74, 30 );
146148

147149
context.fillRect( 76, 15, 1, 30 );
148150

149151
context.fillStyle = bg;
150152
context.globalAlpha = 0.9;
151-
context.fillRect( 76, 15, 1, 30 - ( ( value / maxValue ) * 30 ) | 0 );
153+
context.fillRect( 76, 15, 1, 30 - round( ( value / maxValue ) * 30 ) );
152154

153155
}
154156

0 commit comments

Comments
 (0)