Skip to content

Commit

Permalink
use distance conversion function for setting aria-valuetext, see #109
Browse files Browse the repository at this point in the history
  • Loading branch information
mbarlow12 committed Dec 10, 2018
1 parent e50c2a6 commit 765086a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions js/gravity-force-lab/view/GravityForceLabStringManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ define( require => {
valueUnits: micronewtonsString,
centerOffset: 4.8,
convertForceValue,
convertDistanceApart: distance => Util.toFixedNumber( distance, 2 ),
convertDistanceMetric: distance => Util.toFixedNumber( distance, 1 ),
formatPositionUnitMark: position => {
position = Util.toFixedNumber( position, 1 );
return StringUtils.fillIn( '{{position}} meter', { position } );
Expand Down Expand Up @@ -178,12 +178,13 @@ define( require => {
return StringUtils.fillIn( pattern, { massValue, size, relativeSize, otherObject } );
}

getSpherePositionAriaValueText( newPosition, objectEnum ) {
return super.getSpherePositionAriaValueText( Util.toFixedNumber( newPosition + 4.8, 1 ), objectEnum );
getSpherePositionAriaValueText( newPosition, objectNode ) {
newPosition = this.convertDistanceMetric( newPosition + this.centerOffset );
return super.getSpherePositionAriaValueText( newPosition, objectNode );
}

getSpherePositionAndRegionText( position, objectEnum ) {
position = Util.toFixedNumber( position + 4.8, 1 );
position = this.convertDistanceMetric( position + this.centerOffset );
return super.getSpherePositionAndRegionText( position, objectEnum );
}

Expand Down

0 comments on commit 765086a

Please sign in to comment.