Skip to content

Commit

Permalink
move trackBorder closer to track, #261
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelzoom committed Aug 24, 2016
1 parent 0cca299 commit a87d690
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions js/WavelengthSlider.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,19 @@ define( function( require ) {
var track = new SpectrumNode( options.trackWidth, options.trackHeight, options.minWavelength, options.maxWavelength, options.trackOpacity );
track.cursor = 'pointer'; //TODO add options param to SpectrumNode

/*
* Put a border around the track.
* We don't stroke the track itself because stroking the track will affect its bounds,
* and will thus affect the drag handle behavior.
* Having a separate border also gives subclasses a place to add markings (eg, tick marks)
* without affecting the track's bounds.
*/
var trackBorder = new Rectangle( 0, 0, track.width, track.height, {
stroke: options.trackBorderStroke,
lineWidth: 1,
pickable: false
} );

var valueDisplay;
if ( options.valueVisible ) {
valueDisplay = new ValueDisplay( wavelengthProperty, {
Expand Down Expand Up @@ -183,19 +196,6 @@ define( function( require ) {
.shiftedX( -options.tweakersMouseAreaXDilation );
}

/*
* Put a border around the track.
* We don't stroke the track itself because stroking the track will affect its bounds,
* and will thus affect the drag handle behavior.
* Having a separate border also gives subclasses a place to add markings (eg, tick marks)
* without affecting the track's bounds.
*/
var trackBorder = new Rectangle( 0, 0, track.width, track.height, {
stroke: options.trackBorderStroke,
lineWidth: 1,
pickable: false
} );

// rendering order
thisNode.addChild( track );
thisNode.addChild( trackBorder );
Expand Down

0 comments on commit a87d690

Please sign in to comment.