Skip to content

Commit

Permalink
instrument pickers #14
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Malley <[email protected]>
  • Loading branch information
pixelzoom committed Sep 28, 2018
1 parent 13370c3 commit 3612abb
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 9 deletions.
17 changes: 12 additions & 5 deletions js/standardform/view/StandardFormInteractiveEquationNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,27 @@ define( require => {
const bProperty = new NumberProperty( bRange.defaultValue, { range: bRange } );
const cProperty = new NumberProperty( cRange.defaultValue, { range: cRange } );

//TODO #14 instrument pickers so they can be disabled
// coefficient pickers
const numberPickerOptions = {
font: new PhetFont( GQConstants.INTERACTIVE_EQUATION_FONT_SIZE ),
color: GQColors.STANDARD_FORM_INTERACTIVE_CURVE,
xMargin: 5,
touchAreaXDilation: GQConstants.PICKER_TOUCH_AREA_X_DILATION
};
const aNumberPicker = new NumberPicker( aProperty, new Property( aProperty.range ),
_.extend( {}, numberPickerOptions, { color: GQColors.STANDARD_FORM_A } ) );
_.extend( {
color: GQColors.STANDARD_FORM_A,
tandem: options.tandem.createTandem( 'aNumberPicker' )
}, numberPickerOptions ) );
const bNumberPicker = new NumberPicker( bProperty, new Property( bProperty.range ),
_.extend( {}, numberPickerOptions, { color: GQColors.STANDARD_FORM_B } ) );
_.extend( {
color: GQColors.STANDARD_FORM_B,
tandem: options.tandem.createTandem( 'bNumberPicker' )
}, numberPickerOptions ) );
const cNumberPicker = new NumberPicker( cProperty, new Property( cProperty.range ),
_.extend( {}, numberPickerOptions, { color: GQColors.STANDARD_FORM_C } ) );
_.extend( {
color: GQColors.STANDARD_FORM_C,
tandem: options.tandem.createTandem( 'cNumberPicker' )
}, numberPickerOptions ) );

// static parts of the equation
const richTextOptions = {
Expand Down
16 changes: 12 additions & 4 deletions js/vertexform/view/VertexFormInteractiveEquationNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,27 @@ define( require => {
const hProperty = new NumberProperty( hRange.defaultValue, { range: hRange } );
const kProperty = new NumberProperty( kRange.defaultValue, { range: kRange } );

//TODO #14 instrument pickers so they can be disabled
// Coefficient pickers
const numberPickerOptions = {
font: new PhetFont( GQConstants.INTERACTIVE_EQUATION_FONT_SIZE ),
xMargin: 5,
touchAreaXDilation: GQConstants.PICKER_TOUCH_AREA_X_DILATION
};
const aNumberPicker = new NumberPicker( aProperty, new Property( aProperty.range ),
_.extend( {}, numberPickerOptions, { color: GQColors.VERTEX_FORM_A } ) );
_.extend( {
color: GQColors.VERTEX_FORM_A,
tandem: options.tandem.createTandem( 'aNumberPicker' )
}, numberPickerOptions ) );
const hNumberPicker = new NumberPicker( hProperty, new Property( hProperty.range ),
_.extend( {}, numberPickerOptions, { color: GQColors.VERTEX_FORM_H } ) );
_.extend( {
color: GQColors.VERTEX_FORM_H,
tandem: options.tandem.createTandem( 'hNumberPicker' )
}, numberPickerOptions ) );
const kNumberPicker = new NumberPicker( kProperty, new Property( kProperty.range ),
_.extend( {}, numberPickerOptions, { color: GQColors.VERTEX_FORM_K } ) );
_.extend( {
color: GQColors.VERTEX_FORM_K,
tandem: options.tandem.createTandem( 'kNumberPicker' )
}, numberPickerOptions ) );

// static parts of the equation
const richTextOptions = {
Expand Down

0 comments on commit 3612abb

Please sign in to comment.