Skip to content

Commit

Permalink
Instrument thermometer slider and cueing arrows, removed unused node,…
Browse files Browse the repository at this point in the history
… see #83
  • Loading branch information
chrisklus committed Apr 24, 2019
1 parent 1dc1bd3 commit 2f0d4e6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
6 changes: 0 additions & 6 deletions js/blackbody-spectrum/view/BlackbodySpectrumScreenView.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,6 @@ define( function( require ) {
tandem: tandem.createTandem( 'thermometerNode' )
} );

// Note: for VSlider nodes, coordinates go where x axis is from bottom to top, and y axis is from left to right
// The selectable triangle for the temperature slider
var thumbSize = new Dimension2( TRIANGLE_SIZE, TRIANGLE_SIZE );
var triangleNode = new TriangleSliderThumb( { size: thumbSize } );
triangleNode.touchArea = triangleNode.localBounds.dilatedXY( 10, 10 );

var thermometerLabel = new RichText( blackbodyTemperatureString, {
font: LABEL_FONT,
fill: TITLE_COLOR,
Expand Down
6 changes: 5 additions & 1 deletion js/blackbody-spectrum/view/BlackbodySpectrumThermometer.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ define( function( require ) {

var thumbDimension = new Dimension2( options.thumbSize, options.thumbSize );
// REVIEW: Needs doc
this.triangleNode = new TriangleSliderThumb( { size: thumbDimension } );
this.triangleNode = new TriangleSliderThumb( {
size: thumbDimension,
tandem: options.tandem.createTandem( 'slider' )
} );
this.triangleNode.touchArea = this.triangleNode.localBounds.dilatedXY( 10, 10 );

var clickYOffset;
this.triangleNode.addInputListener( new SimpleDragHandler( {
Expand Down
7 changes: 5 additions & 2 deletions js/blackbody-spectrum/view/TriangleSliderThumb.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ define( function( require ) {
var Node = require( 'SCENERY/nodes/Node' );
var Path = require( 'SCENERY/nodes/Path' );
var Shape = require( 'KITE/Shape' );
var Tandem = require( 'TANDEM/Tandem' );

/**
* Creates the triangle thumb slider
Expand All @@ -40,7 +41,8 @@ define( function( require ) {
stroke: blackbodyColorProfile.triangleStrokeProperty,
lineDash: [ 3, 3 ]
},
cursor: 'pointer'
cursor: 'pointer',
tandem: Tandem.required
}, options );

// Draw the thumb shape starting at the bottom corner, moving up to the top left
Expand Down Expand Up @@ -68,7 +70,8 @@ define( function( require ) {
tailWidth: 7
};
this.cueingArrows = new Node( {
children: [ new ArrowNode( 15, 0, 40, 0, ARROW_OPTIONS ), new ArrowNode( -15, 0, -40, 0, ARROW_OPTIONS ) ]
children: [ new ArrowNode( 15, 0, 40, 0, ARROW_OPTIONS ), new ArrowNode( -15, 0, -40, 0, ARROW_OPTIONS ) ],
tandem: options.tandem.createTandem( 'cueingArrows' )
} );

Path.call( this, shape, options );
Expand Down

0 comments on commit 2f0d4e6

Please sign in to comment.