phetsims / molecule-shapes

"Molecule Shapes" is an educational simulation in HTML5, by PhET Interactive Simulations.
http://phet.colorado.edu/en/simulation/molecule-shapes
GNU General Public License v3.0
5 stars 6 forks source link

bond length is longer in studio #233

Closed Nancy-Salpepi closed 1 year ago

Nancy-Salpepi commented 1 year ago

Test device MacBook air (m1 chip)

Operating System MacOS 13.0

Browser safari/chrome Also seen on Win 10 + chrome

Problem description For https://github.com/phetsims/qa/issues/845 and https://github.com/phetsims/qa/issues/844 In Studio: When adding bonds to the central atom, the bond length is much longer than in the sim.

Visuals

https://user-images.githubusercontent.com/87318828/197882116-fca3c9e9-be9d-4def-9c6f-4e6090d1b2ba.mp4

arouinfar commented 1 year ago

I tried to reproduce this, but I'm not really noticing a difference. Here's a side-by-side comparison of the molecule in Studio, the molecule in the Standard PhET-iO Wrapper (pressing Test in Studio), and the phet-brand version of the sim. Removing and adding bonds in the Standard Wrapper doesn't seem to change anything for me, either.

Studio Standard Wrapper phet-brand
image image image

Here's my troubleshooting info:

Name: ‪Molecule Shapes: Basics‬ URL: https://phet-dev.colorado.edu/html/molecule-shapes-basics/1.5.0-dev.2/phet/molecule-shapes-basics_all_phet.html Version: 1.5.0-dev.2 2022-10-20 17:39:46 UTC Features missing: applicationcache, applicationcache, touch User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36 Language: en-US Window: 795x478 Pixel Ratio: 1/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: 31 uniform: 1024 Texture: size: 16384 imageUnits: 16 (vertex: 16, combined: 32) Max viewport: 16384x16384 OES_texture_float: true Dependencies JSON: {}

Nancy-Salpepi commented 1 year ago

@arouinfar it looks the same AFTER it is added. It is while the bond is being added that things look weird. I paused the video above at the 2 second mark and took a snapshot. It looks fine in the sim itself, but I thought I would mention it. I believe @KatieWoe was also able to reproduce this.

Screenshot 2022-11-11 at 1 23 25 PM
arouinfar commented 1 year ago

Ooooh, that's so noticeable. Guess I never really watched the animation, but now that I know what to look for it's very obvious. Thanks @Nancy-Salpepi!

Any idea what's going on here @jonathanolson?

samreid commented 1 year ago

I added a fix in the commit. PhET-iO was setting bondLengthOverride to null, but the sim was only dealing with undefined. The commit probably unblocks the sim from moving forward, but may be good to double check with @jonathanolson if we should get rid of undefined altogether? Or any other updates like that.

KatieWoe commented 1 year ago

Looks fixed on master

arouinfar commented 1 year ago

Thanks @samreid. I agree with @KatieWoe, things look good in master. Since there's still a question for @jonathanolson in https://github.com/phetsims/molecule-shapes/issues/233#issuecomment-1355396489, I'll leave this issue open.

jonathanolson commented 1 year ago

Improved handling above, @samreid's fix looks great, thanks!