Skip to content

Commit

Permalink
never overwrite default options, instrument all numberDisplays, #177
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Oct 11, 2019
1 parent 8eee80a commit e33e2ec
Show file tree
Hide file tree
Showing 4 changed files with 695 additions and 46 deletions.
7 changes: 4 additions & 3 deletions js/common/view/TargetNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ define( require => {
const Circle = require( 'SCENERY/nodes/Circle' );
const Easing = require( 'TWIXT/Easing' );
const inherit = require( 'PHET_CORE/inherit' );
const merge = require( 'PHET_CORE/merge' );
const Node = require( 'SCENERY/nodes/Node' );
const NumberDisplay = require( 'SCENERY_PHET/NumberDisplay' );
const projectileMotion = require( 'PROJECTILE_MOTION/projectileMotion' );
Expand Down Expand Up @@ -128,14 +129,14 @@ define( require => {
transformProperty.get().viewToModelX( screenView.layoutBounds.minX ),
transformProperty.get().viewToModelX( screenView.layoutBounds.maxX )
),
_.extend(
ProjectileMotionConstants.NUMBER_DISPLAY_OPTIONS, {
merge( {}, ProjectileMotionConstants.NUMBER_DISPLAY_OPTIONS, {
numberFill: 'black',
valuePattern: distancePattern,
xMargin: 10.5,
yMargin: 2,
decimalPlaces: 1,
cursor: 'pointer'
cursor: 'pointer',
tandem: tandem.createTandem( 'numberDisplay' )
}
)
);
Expand Down
11 changes: 5 additions & 6 deletions js/drag/view/DragProjectilePanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,11 @@ define( require => {
const numberDisplay = new NumberDisplay(
valueProperty,
range,
_.extend(
ProjectileMotionConstants.NUMBER_DISPLAY_OPTIONS, {
valuePattern: StringUtils.fillIn( pattern0Value1UnitsWithSpaceString, { units: unitsString } ),
decimalPlaces: null,
tandem: tandem.createTandem( 'numberDisplay' )
} )
merge( {}, ProjectileMotionConstants.NUMBER_DISPLAY_OPTIONS, {
valuePattern: StringUtils.fillIn( pattern0Value1UnitsWithSpaceString, { units: unitsString } ),
decimalPlaces: null,
tandem: tandem.createTandem( 'numberDisplay' )
} )
);

const slider = new HSlider( valueProperty, range, {
Expand Down
Loading

0 comments on commit e33e2ec

Please sign in to comment.