From ec0328be78a8f04bbced8059053f1b1b50e7caa8 Mon Sep 17 00:00:00 2001 From: pixelzoom Date: Fri, 9 Sep 2022 18:02:51 -0600 Subject: [PATCH] use 'Text' suffix on a couple of variable names --- js/common/view/SoluteComboBox.ts | 4 ++-- js/common/view/VolumeIndicatorNode.ts | 8 +++---- js/macro/view/MacroPHMeterNode.ts | 32 +++++++++++++-------------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/js/common/view/SoluteComboBox.ts b/js/common/view/SoluteComboBox.ts index 7371333f..520e774d 100644 --- a/js/common/view/SoluteComboBox.ts +++ b/js/common/view/SoluteComboBox.ts @@ -51,14 +51,14 @@ export default class SoluteComboBox extends ComboBox { } ); // 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( { diff --git a/js/common/view/VolumeIndicatorNode.ts b/js/common/view/VolumeIndicatorNode.ts index a58f6912..f47c6c86 100644 --- a/js/common/view/VolumeIndicatorNode.ts +++ b/js/common/view/VolumeIndicatorNode.ts @@ -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 diff --git a/js/macro/view/MacroPHMeterNode.ts b/js/macro/view/MacroPHMeterNode.ts index f1d48de5..214a00ad 100644 --- a/js/macro/view/MacroPHMeterNode.ts +++ b/js/macro/view/MacroPHMeterNode.ts @@ -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; @@ -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 @@ -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 @@ -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 @@ -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 ); @@ -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 => {