Skip to content

Commit

Permalink
Make plusNode black and left align decay equation. See #80.
Browse files Browse the repository at this point in the history
  • Loading branch information
Luisav1 committed Jul 17, 2023
1 parent 28eae7d commit 89d8435
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
4 changes: 3 additions & 1 deletion js/chart-intro/view/DecayEquationNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: ' ' } );

Expand All @@ -30,6 +31,7 @@ class DecayEquationNode extends VBox {

super( {
spacing: 5,
align: 'left',

// leave equationHBox space visible despite being blank sometimes
excludeInvisibleChildrenFromBounds: false
Expand Down Expand Up @@ -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 ) {

Expand Down
1 change: 1 addition & 0 deletions js/chart-intro/view/NuclideChartAccordionBox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ class NuclideChartAccordionBox extends AccordionBox {
chartsHBox,
nuclideChartLegendNode
],
align: 'left',
spacing: 10,
excludeInvisibleChildrenFromBounds: true
} );
Expand Down
4 changes: 4 additions & 0 deletions js/common/BANColors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
} )
};

Expand Down
8 changes: 4 additions & 4 deletions js/decay/view/IconFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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 ) } );
}

/**
Expand All @@ -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 )
],
Expand Down

0 comments on commit 89d8435

Please sign in to comment.