Skip to content

Commit

Permalink
use 'Text' suffix on a couple of variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelzoom committed Sep 10, 2022
1 parent a528bde commit ec0328b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
4 changes: 2 additions & 2 deletions js/common/view/SoluteComboBox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ export default class SoluteComboBox extends ComboBox<Solute> {
} );

// label
const textNode = new Text( solute.nameProperty, {
const labelText = new Text( solute.nameProperty, {
font: new PhetFont( 22 ),
maxWidth: 140 // determined empirically
} );

const hBox = new HBox( {
spacing: 5,
children: [ colorNode, textNode ]
children: [ colorNode, labelText ]
} );

items.push( {
Expand Down
8 changes: 4 additions & 4 deletions js/common/view/VolumeIndicatorNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,21 @@ export default class VolumeIndicatorNode extends Node {
);

// volume value
const valueNode = new Text( valueStringProperty, {
const valueText = new Text( valueStringProperty, {
font: VALUE_FONT,
left: arrowHead.right + 3,
maxWidth: 75
} );

options.children = [ valueNode, arrowHead ];
options.children = [ valueText, arrowHead ];

super( options );

// x position
this.left = modelViewTransform.modelToViewX( beaker.right ) + 3;

valueNode.boundsProperty.link( bounds => {
valueNode.centerY = arrowHead.centerY;
valueText.boundsProperty.link( bounds => {
valueText.centerY = arrowHead.centerY;
} );

// update position of the indicator
Expand Down
32 changes: 16 additions & 16 deletions js/macro/view/MacroPHMeterNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,10 @@ class ScaleNode extends Node {

// tick label
if ( pH % 2 === 0 ) {
const tickLabelNode = new Text( pH, { font: TICK_FONT } );
tickLabelNode.right = lineNode.left - TICK_LABEL_X_SPACING;
tickLabelNode.centerY = lineNode.centerY;
this.addChild( tickLabelNode );
const tickText = new Text( pH, { font: TICK_FONT } );
tickText.right = lineNode.left - TICK_LABEL_X_SPACING;
tickText.centerY = lineNode.centerY;
this.addChild( tickText );
}
}
y += dy;
Expand All @@ -214,13 +214,13 @@ class ScaleNode extends Node {
neutralLineNode.right = backgroundNode.left;
neutralLineNode.centerY = options.size.height / 2;
this.addChild( neutralLineNode );
const neutralLabelNode = new Text( '7', {
const neutralText = new Text( '7', {
fill: PHScaleColors.NEUTRAL,
font: new PhetFont( { family: 'Arial black', size: 28, weight: 'bold' } )
} );
this.addChild( neutralLabelNode );
neutralLabelNode.right = neutralLineNode.left - TICK_LABEL_X_SPACING;
neutralLabelNode.centerY = neutralLineNode.centerY;
this.addChild( neutralText );
neutralText.right = neutralLineNode.left - TICK_LABEL_X_SPACING;
neutralText.centerY = neutralLineNode.centerY;
}

// needed for precise positioning of things that point to values on the scale
Expand Down Expand Up @@ -367,7 +367,7 @@ class PHIndicatorNode extends Node {
} );

// label above the value
const labelNode = new Text( PhScaleStrings.pHStringProperty, {
const pHText = new Text( PhScaleStrings.pHStringProperty, {
fill: 'white',
font: new PhetFont( { size: 28, weight: 'bold' } ),
maxWidth: 100
Expand All @@ -377,8 +377,8 @@ class PHIndicatorNode extends Node {
const backgroundXMargin = 14;
const backgroundYMargin = 10;
const backgroundYSpacing = 6;
const backgroundWidth = Math.max( labelNode.width, numberDisplay.width ) + ( 2 * backgroundXMargin );
const backgroundHeight = labelNode.height + numberDisplay.height + backgroundYSpacing + ( 2 * backgroundYMargin );
const backgroundWidth = Math.max( pHText.width, numberDisplay.width ) + ( 2 * backgroundXMargin );
const backgroundHeight = pHText.height + numberDisplay.height + backgroundYSpacing + ( 2 * backgroundYMargin );
const backgroundRectangle = new Rectangle( 0, 0, backgroundWidth, backgroundHeight, {
cornerRadius: CORNER_RADIUS,
fill: BACKGROUND_ENABLED_FILL
Expand Down Expand Up @@ -414,7 +414,7 @@ class PHIndicatorNode extends Node {
this.addChild( arrowNode );
this.addChild( backgroundRectangle );
this.addChild( highlight );
this.addChild( labelNode );
this.addChild( pHText );
this.addChild( numberDisplay );
this.addChild( lineNode );

Expand All @@ -427,13 +427,13 @@ class PHIndicatorNode extends Node {
backgroundRectangle.centerY = arrowNode.centerY;
highlight.center = backgroundRectangle.center;

labelNode.boundsProperty.link( bounds => {
labelNode.centerX = backgroundRectangle.centerX;
labelNode.top = backgroundRectangle.top + backgroundYMargin;
pHText.boundsProperty.link( bounds => {
pHText.centerX = backgroundRectangle.centerX;
pHText.top = backgroundRectangle.top + backgroundYMargin;
} );

numberDisplay.centerX = backgroundRectangle.centerX;
numberDisplay.top = labelNode.bottom + backgroundYSpacing;
numberDisplay.top = pHText.bottom + backgroundYSpacing;

pHProperty.link( pH => {

Expand Down

0 comments on commit ec0328b

Please sign in to comment.