Skip to content

Commit

Permalink
convert _.extend to PHET_CORE/merge, phetsims/phet-core#71
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Oct 17, 2019
1 parent 5cdb0d0 commit f04a10a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
7 changes: 4 additions & 3 deletions js/blackbox/view/WarmUpSceneView.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ define( require => {

// modules
const BlackBoxSceneView = require( 'CIRCUIT_CONSTRUCTION_KIT_BLACK_BOX_STUDY/blackbox/view/BlackBoxSceneView' );
const circuitConstructionKitBlackBoxStudy = require( 'CIRCUIT_CONSTRUCTION_KIT_BLACK_BOX_STUDY/circuitConstructionKitBlackBoxStudy' );
const Circuit = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/model/Circuit' );
const circuitConstructionKitBlackBoxStudy = require( 'CIRCUIT_CONSTRUCTION_KIT_BLACK_BOX_STUDY/circuitConstructionKitBlackBoxStudy' );
const merge = require( 'PHET_CORE/merge' );
const MultiLineText = require( 'SCENERY_PHET/MultiLineText' );
const Property = require( 'AXON/Property' );
const ScreenView = require( 'JOIST/ScreenView' );
Expand All @@ -36,7 +37,7 @@ define( require => {
};

// TODO: i18n
const questionText = new MultiLineText( 'What circuit is\nin the black box?', _.extend( {
const questionText = new MultiLineText( 'What circuit is\nin the black box?', merge( {
centerX: ScreenView.DEFAULT_LAYOUT_BOUNDS.width / 2,
top: ScreenView.DEFAULT_LAYOUT_BOUNDS.height / 6
}, textOptions ) );
Expand All @@ -45,7 +46,7 @@ define( require => {
} );

// TODO: i18n
const tryToText = new MultiLineText( 'Build a circuit that\nbehaves the same way.', _.extend( {
const tryToText = new MultiLineText( 'Build a circuit that\nbehaves the same way.', merge( {
centerX: ScreenView.DEFAULT_LAYOUT_BOUNDS.width / 2,
top: ScreenView.DEFAULT_LAYOUT_BOUNDS.height / 6
}, textOptions ) );
Expand Down
17 changes: 9 additions & 8 deletions js/explore/view/CCKIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,20 @@ define( require => {
'use strict';

// modules
const circuitConstructionKitBlackBoxStudy = require( 'CIRCUIT_CONSTRUCTION_KIT_BLACK_BOX_STUDY/circuitConstructionKitBlackBoxStudy' );
const Rectangle = require( 'SCENERY/nodes/Rectangle' );
const Screen = require( 'JOIST/Screen' );
const Vector2 = require( 'DOT/Vector2' );
const CCKCConstants = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/CCKCConstants' );
const circuitConstructionKitBlackBoxStudy = require( 'CIRCUIT_CONSTRUCTION_KIT_BLACK_BOX_STUDY/circuitConstructionKitBlackBoxStudy' );
const CustomLightBulbNode = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/view/CustomLightBulbNode' );
const HBox = require( 'SCENERY/nodes/HBox' );
const Image = require( 'SCENERY/nodes/Image' );
const merge = require( 'PHET_CORE/merge' );
const NumberProperty = require( 'AXON/NumberProperty' );
const Property = require( 'AXON/Property' );
const Rectangle = require( 'SCENERY/nodes/Rectangle' );
const Resistor = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/model/Resistor' );
const ResistorNode = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/view/ResistorNode' );
const Screen = require( 'JOIST/Screen' );
const VBox = require( 'SCENERY/nodes/VBox' );
const Vector2 = require( 'DOT/Vector2' );
const Vertex = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/model/Vertex' );
const Wire = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/model/Wire' );
const WireNode = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/view/WireNode' );
Expand Down Expand Up @@ -66,10 +67,10 @@ define( require => {
focusable: false
};

resistorNode.mutate( _.extend( a11yIconOptions, { scale: ELEMENT_WIDTH / resistorNode.width * 0.75 } ) );
wireNode.mutate( _.extend( a11yIconOptions, { scale: ELEMENT_WIDTH / wireNode.width * 0.7 } ) );
batteryNode.mutate( _.extend( a11yIconOptions, { scale: ELEMENT_WIDTH / batteryNode.width } ) );
lightBulbNode.mutate( _.extend( a11yIconOptions, { scale: ELEMENT_WIDTH / lightBulbNode.width / 2 } ) );
resistorNode.mutate( merge( a11yIconOptions, { scale: ELEMENT_WIDTH / resistorNode.width * 0.75 } ) );
wireNode.mutate( merge( a11yIconOptions, { scale: ELEMENT_WIDTH / wireNode.width * 0.7 } ) );
batteryNode.mutate( merge( a11yIconOptions, { scale: ELEMENT_WIDTH / batteryNode.width } ) );
lightBulbNode.mutate( merge( a11yIconOptions, { scale: ELEMENT_WIDTH / lightBulbNode.width / 2 } ) );
const vBox = new VBox( {
spacing: 20,
children: [ new HBox( { spacing: 20, children: [ wireNode, resistorNode ] } ), new HBox( {
Expand Down

0 comments on commit f04a10a

Please sign in to comment.