Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Un-instrument text in TextPushButton #850

Closed
jbphet opened this issue Aug 8, 2023 · 2 comments
Closed

Un-instrument text in TextPushButton #850

jbphet opened this issue Aug 8, 2023 · 2 comments

Comments

@jbphet
Copy link
Contributor

jbphet commented Aug 8, 2023

In phetsims/greenhouse-effect#341 I was asked to remove the phet-io instrumentation of the text in a button due to changes in the way instrumentation of text is done. Upon investigation, it looks like the instrumentation of the text is actually in the TextPushButton common code class. There is an existing general issue about removing text instrumentation, see https://github.com/phetsims/phet-io/issues/1952, and I guess this is a specific instance of a case where that change is needed.

Looking at the code in TextPushButton, I think all that needs to happen is that the tandem is removed from the text node. Here's an excerpt:

    const text = new Text( string, combineOptions<TextOptions>( {
      font: options.font,
      fill: options.textFill,
      maxWidth: options.maxTextWidth,
      tandem: options.tandem.createTandem( 'text' )
    }, options.textNodeOptions ) );
@jbphet
Copy link
Contributor Author

jbphet commented Aug 8, 2023

I am reluctant to do this without first consulting with the phet-io team, since I believe this will change the phet-io API for a number of sims, and I'm not sure how we are supposed to handle that.

@jbphet
Copy link
Contributor Author

jbphet commented Aug 14, 2023

@samreid and I reviewed the changes to the code and the API files in a meeting and they have been approved. Closing.

@jbphet jbphet closed this as completed Aug 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant