From a87d690f44ef4b362274983b93e16cb70d6b9a25 Mon Sep 17 00:00:00 2001 From: Chris Malley Date: Tue, 23 Aug 2016 18:28:53 -0600 Subject: [PATCH] move trackBorder closer to track, #261 --- js/WavelengthSlider.js | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/js/WavelengthSlider.js b/js/WavelengthSlider.js index 948d3be05..4de8706e1 100644 --- a/js/WavelengthSlider.js +++ b/js/WavelengthSlider.js @@ -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, { @@ -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 );