Skip to content

Commit

Permalink
remove setValueToPositionFunction, see #528
Browse files Browse the repository at this point in the history
  • Loading branch information
jessegreenberg committed Sep 25, 2019
1 parent 512a30a commit 83259e9
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions js/SliderTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ define( require => {
// @public (read-only)
this.size = options.size;

// @private - linear function that maps property value to position along the track. Set after construction and
// if/when the function changes.
// @public (read-only) - maps the value along the range of the track to the position along the width of the track
this.valueToPosition = new LinearFunction( range.min, range.max, 0, this.size.width, true /* clamp */ );

// click in the track to change the value, continue dragging if desired
Expand Down Expand Up @@ -87,25 +86,12 @@ define( require => {
} );
trackNode.addInputListener( trackInputListener );

// @public (read-only) - maps the value along the range of the track to the position along the width of the track
this.valueToPosition = new LinearFunction( range.min, range.max, 0, this.size.width, true /* clamp */ );

// @private Called by dispose
this.disposeSliderTrack = () => {
trackInputListener.dispose();
};
}

/**
* Sets the function that converts a model value to a slider and track position.
* @param {LinearFunction} valueToPosition
* @public
*/
setValueToPositionFunction( valueToPosition ) {
assert && assert( valueToPosition, 'valueToPosition should be defined' );
this.valueToPosition = valueToPosition;
}

// @public - ensures that this object is eligible for GC
dispose() {
this.disposeSliderTrack();
Expand Down

0 comments on commit 83259e9

Please sign in to comment.