From 16bdec28c43b0db0c8997c70f8ad4154cba1a863 Mon Sep 17 00:00:00 2001 From: zepumph Date: Thu, 30 Mar 2017 12:28:47 -0600 Subject: [PATCH] implement particle placement highlighting using select menu, https://github.com/phetsims/build-an-atom/issues/150 --- js/common/view/AtomView.js | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/js/common/view/AtomView.js b/js/common/view/AtomView.js index 6c195e63..49058c05 100644 --- a/js/common/view/AtomView.js +++ b/js/common/view/AtomView.js @@ -37,8 +37,6 @@ define( function( require ) { var Vector2 = require( 'DOT/Vector2' ); var VerticalCheckBoxGroup = require( 'SUN/VerticalCheckBoxGroup' ); var BooleanProperty = require( 'AXON/BooleanProperty' ); - var Circle = require( 'SCENERY/nodes/Circle' ); - var Property = require( 'AXON/Property' ); // strings var elementString = require( 'string!BUILD_AN_ATOM/element' ); @@ -115,23 +113,6 @@ define( function( require ) { var electronLayer = new Node( { layerSplit: true, tandem: tandem.createTandem( 'electronLayer' ) } ); nucleonElectronLayer.addChild( electronLayer ); - // a11y - to focus around the actual nucleus, will change in size when the particles in the nucleus change - var nucleusFocusHighlight = new Circle( model.particleAtom.nucleusRadius, { - lineWidth: 2, - stroke: 'red', - center: modelViewTransform.modelToViewPosition( model.particleAtom.positionProperty.get() ), - } ); - this.addChild( nucleusFocusHighlight ); - - // whenever a nucleon is added or removed, change the highlight radius - Property.multilink( [ model.particleAtom.protonCountProperty, model.particleAtom.neutronCountProperty ], function( protonCount, neutronCount ) { - - // TODO: Is there another way to link to the changing nucleus configuration - model.particleAtom.reconfigureNucleus(); - var radiusOffset = model.particleAtom.nucleusRadius === 0 ? 0 : 4; - nucleusFocusHighlight.radius = model.particleAtom.nucleusRadius + radiusOffset; - } ); - // Add the nucleon particle views. var nucleonsGroupTandem = tandem.createGroupTandem( 'nucleons' ); var electronsGroupTandem = tandem.createGroupTandem( 'electrons' ); @@ -216,7 +197,7 @@ define( function( require ) { var nearestParticle = bucket.extractClosestParticle( new Vector2( 0, 0 ) ); // move it to the first drop location (offset by a little to indicate it is still being placed) - model.moveParticleToDropLocation( nearestParticle, model.accessibleDropLocations.NUCLEUS.minusXY( 5, -5 ) ); + model.moveParticleToDropLocation( nearestParticle, model.accessibleDropLocations.NUCLEUS.minusXY( 50, -50 ) ); } } ); } );