Skip to content

Commit

Permalink
Use Util.roundSymmetric, see phetsims/wave-interference#191
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Nov 28, 2018
1 parent e853896 commit 6061e28
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion js/common/model/Lattice.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ define( require => {
const Bounds2 = require( 'DOT/Bounds2' );
const Emitter = require( 'AXON/Emitter' );
const Matrix = require( 'DOT/Matrix' );
const Util = require( 'DOT/Util' );
const waveInterference = require( 'WAVE_INTERFERENCE/waveInterference' );

// constants
Expand Down Expand Up @@ -127,7 +128,7 @@ define( require => {
if ( array.length !== samplingWidth ) {
array.length = 0;
}
const samplingVerticalLocation = Math.round( this.height / 2 );
const samplingVerticalLocation = Util.roundSymmetric( this.height / 2 );
for ( let i = 0; i < this.width - this.dampX * 2; i++ ) {
array[ i ] = this.getCurrentValue( i + this.dampX, samplingVerticalLocation );
}
Expand Down

0 comments on commit 6061e28

Please sign in to comment.