Skip to content

Commit

Permalink
Move eslint-disable directives, see phetsims/chipper#791
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Sep 23, 2019
1 parent d6f0e6f commit ec7b106
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
11 changes: 5 additions & 6 deletions js/common/view/LatticeCanvasNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* @author Sam Reid (PhET Interactive Simulations)
*/
define( require => { // eslint-disable-line bad-sim-text
define( require => {
'use strict';

// modules
Expand Down Expand Up @@ -122,12 +122,11 @@ define( require => { // eslint-disable-line bad-sim-text
b = this.vacuumColor.b;
}

// ImageData.data is Uint8ClampedArray. Use Math.round instead of Util.roundSymmetric
// because performance is critical and all numbers are non-negative.
// ImageData.data is Uint8ClampedArray. Performance is critical and all numbers are non-negative.
const offset = 4 * m;
data[ offset ] = Math.round( r );
data[ offset + 1 ] = Math.round( g );
data[ offset + 2 ] = Math.round( b );
data[ offset ] = Math.round( r ); // eslint-disable-line bad-sim-text
data[ offset + 1 ] = Math.round( g ); // eslint-disable-line bad-sim-text
data[ offset + 2 ] = Math.round( b ); // eslint-disable-line bad-sim-text
data[ offset + 3 ] = 255; // Fully opaque
m++;
}
Expand Down
11 changes: 5 additions & 6 deletions js/diffraction/view/MatrixCanvasNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* @author Sam Reid (PhET Interactive Simulations)
*/
define( require => { // eslint-disable-line bad-sim-text
define( require => {
'use strict';

// modules
Expand Down Expand Up @@ -83,12 +83,11 @@ define( require => { // eslint-disable-line bad-sim-text
const g = Math.min( value * this.baseColor.green * SCALE_FACTOR, 255 );
const b = Math.min( value * this.baseColor.blue * SCALE_FACTOR, 255 );

// ImageData.data is Uint8ClampedArray. Use Math.round instead of Util.roundSymmetric
// because performance is critical and all numbers are non-negative.
// ImageData.data is Uint8ClampedArray. Performance is critical and all numbers are non-negative.
const offset = 4 * x;
this.imageDataRenderer.data[ offset ] = Math.round( r );
this.imageDataRenderer.data[ offset + 1 ] = Math.round( g );
this.imageDataRenderer.data[ offset + 2 ] = Math.round( b );
this.imageDataRenderer.data[ offset ] = Math.round( r ); // eslint-disable-line bad-sim-text
this.imageDataRenderer.data[ offset + 1 ] = Math.round( g ); // eslint-disable-line bad-sim-text
this.imageDataRenderer.data[ offset + 2 ] = Math.round( b ); // eslint-disable-line bad-sim-text
this.imageDataRenderer.data[ offset + 3 ] = 255; // Fully opaque
x++;
}
Expand Down

0 comments on commit ec7b106

Please sign in to comment.