phetsims / wave-interference

"Wave Interference" is an educational simulation in HTML5, by PhET Interactive Simulations.
MIT License
19 stars 5 forks source link

Measuring Tape string can be very long #431

Closed KatieWoe closed 5 years ago

KatieWoe commented 5 years ago

Test device Dell Operating System Win 10 Browser Chrome Problem description For https://github.com/phetsims/QA/issues/405 This does occur in the published version. May not be worth fixing, and does not seem to cause any practical problems. When strings are long, the string under the measuring tape becomes very long. Steps to reproduce

  1. set stringTest=long
  2. Pull out the measuring tape

Visuals getthisbig

Troubleshooting information:

!!!!! DO NOT EDIT !!!!! Name: 12345678901234567890123456789012345678901234567890 URL: https://phet-dev.colorado.edu/html/wave-interference/2.0.0-rc.1/phet/wave-interference_all_phet.html?stringTest=long Version: 2.0.0-rc.1 2019-08-13 21:08:49 UTC Features missing: touch Flags: pixelRatioScaling User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36 Language: en-US Window: 1536x722 Pixel Ratio: 2.5/1 WebGL: WebGL 1.0 (OpenGL ES 2.0 Chromium) GLSL: WebGL GLSL ES 1.0 (OpenGL ES GLSL ES 1.0 Chromium) Vendor: WebKit (WebKit WebGL) Vertex: attribs: 16 varying: 30 uniform: 4096 Texture: size: 16384 imageUnits: 16 (vertex: 16, combined: 32) Max viewport: 32767x32767 OES_texture_float: true Dependencies JSON: {}
samreid commented 5 years ago

It appears that setting a maxWidth on the value readout on SCENERY_PHET/MeasuringTapeNode would solve this problem. Ideally it would have a default maxWidth but also allow passing in a different maxWidth via options. Changing this in master and testing would take less than 30 minutes--longer if we take the more general solution and add more options for customizing the MeasuringTapeNode text (such as font, coloring, etc). Patching this into Wave Interference 2.0 and Waves Intro 1.0 (creating branches, cherry-picking, testing, making sure SHAs are right) would take another 30-60 minutes.

My recommendation is to address this in master and not spend time cherry-picking into the Wave Interference branches for this publication, but I'm happy to add it if anyone thinks that is a good use of time.

@arouinfar or @ariel-phet what do you think?

ariel-phet commented 5 years ago

@samreid fine to just change in master. For the most part this string should basically always be an abbreviation and is unlikely to ever be particularly long in any real-world translation.

samreid commented 5 years ago

In master, I set a default max width for the measuring tape, and it is overridable. I used the established pattern in the file which is not our latest and greatest pattern. That will warrant another issue.

@KatieWoe do you mind testing this on master? If all is well, this issue can be closed.

KatieWoe commented 5 years ago

Looks good