Skip to content

Commit

Permalink
pass in Properties to (Rich)Text instead of their string values, phet…
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Aug 26, 2022
1 parent c384d99 commit 2016f44
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions js/view/ProbeTextNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default class ProbeTextNode extends VBox {
spacing: 3
}, providedOptions );

const readout = new Text( textProperty.value, {
const readout = new Text( textProperty, {
fontSize: 40,
maxWidth: TEXT_BOX_WIDTH - 20,
tandem: tandem.createTandem( 'readoutText' )
Expand All @@ -47,8 +47,6 @@ export default class ProbeTextNode extends VBox {
fill: Color.WHITE
} );

textProperty.link( text => readout.setText( text ) );

// Text bounds is not updated eagerly, so wait for the bounds to change for layout
readout.boundsProperty.link( bounds => {
if ( readout.text === MathSymbols.NO_VALUE ) {
Expand Down

0 comments on commit 2016f44

Please sign in to comment.