Skip to content

Commit

Permalink
JSDoc for correctRounding, see #327
Browse files Browse the repository at this point in the history
  • Loading branch information
jessegreenberg committed Nov 20, 2017
1 parent 61856d5 commit b56a02e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions js/accessibility/AccessibleSlider.js
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,16 @@ define( function( require ) {

sun.register( 'AccessibleSlider', AccessibleSlider );

// help function, it is possible due to rounding to go up or down a step if we have passed the nearest step during
// keyboard interaction
/**
* Helper function, it is possible due to rounding to go up or down a step if we have passed the nearest step during
* keyboard interaction. This function corrects that.
*
* @param {number} newValue - potential value of the Property associated with this slider
* @param {number} currentValue - current value of the Property associated with this slider
* @param {number} stepSize - the delta for this manipulation
*
* @return {number}
*/
var correctRounding = function( newValue, currentValue, stepSize ) {
var correctedValue = newValue;
if ( Util.toFixedNumber( Math.abs( newValue - currentValue ), 5 ) > stepSize ) {
Expand Down

0 comments on commit b56a02e

Please sign in to comment.