From 89d843525bb3c6f49dadffd3b316244c6a2039fa Mon Sep 17 00:00:00 2001 From: Luisav1 Date: Mon, 17 Jul 2023 10:19:00 -0600 Subject: [PATCH] Make plusNode black and left align decay equation. See https://github.com/phetsims/build-a-nucleus/issues/80. --- js/chart-intro/view/DecayEquationNode.ts | 4 +++- js/chart-intro/view/NuclideChartAccordionBox.ts | 1 + js/common/BANColors.ts | 4 ++++ js/decay/view/IconFactory.ts | 8 ++++---- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/js/chart-intro/view/DecayEquationNode.ts b/js/chart-intro/view/DecayEquationNode.ts index 05ca992..356371a 100644 --- a/js/chart-intro/view/DecayEquationNode.ts +++ b/js/chart-intro/view/DecayEquationNode.ts @@ -16,6 +16,7 @@ import ArrowNode from '../../../../scenery-phet/js/ArrowNode.js'; import DecaySymbolNode from './DecaySymbolNode.js'; import IconFactory from '../../decay/view/IconFactory.js'; import PatternStringProperty from '../../../../axon/js/PatternStringProperty.js'; +import BANColors from '../../common/BANColors.js'; const unknownSpacePatternStringProperty = new PatternStringProperty( BuildANucleusStrings.unknownSpacePatternStringProperty, { space: ' ' } ); @@ -30,6 +31,7 @@ class DecayEquationNode extends VBox { super( { spacing: 5, + align: 'left', // leave equationHBox space visible despite being blank sometimes excludeInvisibleChildrenFromBounds: false @@ -62,7 +64,7 @@ class DecayEquationNode extends VBox { const newNuclideSymbol = new DecaySymbolNode( decayEquationModel.finalProtonNumberProperty.value, decayEquationModel.finalMassNumberProperty.value ); - const plusNode = IconFactory.createPlusNode(); + const plusNode = IconFactory.createPlusNode( BANColors.decayEquationPlusNodeColorProperty ); if ( currentCellModel.decayType ) { diff --git a/js/chart-intro/view/NuclideChartAccordionBox.ts b/js/chart-intro/view/NuclideChartAccordionBox.ts index 6efd6b0..566285c 100644 --- a/js/chart-intro/view/NuclideChartAccordionBox.ts +++ b/js/chart-intro/view/NuclideChartAccordionBox.ts @@ -92,6 +92,7 @@ class NuclideChartAccordionBox extends AccordionBox { chartsHBox, nuclideChartLegendNode ], + align: 'left', spacing: 10, excludeInvisibleChildrenFromBounds: true } ); diff --git a/js/common/BANColors.ts b/js/common/BANColors.ts index 6ac9ad3..95f3be8 100644 --- a/js/common/BANColors.ts +++ b/js/common/BANColors.ts @@ -130,6 +130,10 @@ const BANColors = { // colors of the energy level bars zeroNucleonsEnergyLevelColorProperty: new ProfileColorProperty( buildANucleus, 'zeroNucleonsEnergyLevelColor', { default: Color.BLACK + } ), + + decayEquationPlusNodeColorProperty: new ProfileColorProperty( buildANucleus, 'decayEquationPlusNodeColor', { + default: Color.BLACK } ) }; diff --git a/js/decay/view/IconFactory.ts b/js/decay/view/IconFactory.ts index 892eda4..ab56823 100644 --- a/js/decay/view/IconFactory.ts +++ b/js/decay/view/IconFactory.ts @@ -11,7 +11,7 @@ import buildANucleus from '../../buildANucleus.js'; import ParticleType from '../../common/model/ParticleType.js'; import ParticleNode from '../../../../shred/js/view/ParticleNode.js'; import BANColors from '../../common/BANColors.js'; -import { HBox, Line, Node, VBox } from '../../../../scenery/js/imports.js'; +import { HBox, Line, Node, TColor, VBox } from '../../../../scenery/js/imports.js'; import ArrowNode from '../../../../scenery-phet/js/ArrowNode.js'; import PlusNode from '../../../../scenery-phet/js/PlusNode.js'; import Dimension2 from '../../../../dot/js/Dimension2.js'; @@ -86,8 +86,8 @@ class IconFactory { } ); } - public static createPlusNode(): Node { - return new PlusNode( { fill: BANColors.blueDecayIconSymbolsColorProperty, size: new Dimension2( 9, 2 ) } ); + public static createPlusNode( fillColor: TColor ): Node { + return new PlusNode( { fill: fillColor, size: new Dimension2( 9, 2 ) } ); } /** @@ -101,7 +101,7 @@ class IconFactory { isBetaMinusDecay ? IconFactory.createParticleNode( ParticleType.NEUTRON ) : IconFactory.createParticleNode( ParticleType.PROTON ), IconFactory.createDecayArrowNode(), isBetaMinusDecay ? IconFactory.createParticleNode( ParticleType.PROTON ) : IconFactory.createParticleNode( ParticleType.NEUTRON ), - IconFactory.createPlusNode(), + IconFactory.createPlusNode( BANColors.blueDecayIconSymbolsColorProperty ), IconFactory.createMotionLines( 3.5, true ), isBetaMinusDecay ? IconFactory.createParticleNode( ParticleType.ELECTRON ) : IconFactory.createParticleNode( ParticleType.POSITRON ) ],