phetsims / build-a-molecule

"Build a Molecule" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
8 stars 7 forks source link

Molecules created with atoms spread out #118

Closed KatieWoe closed 4 years ago

KatieWoe commented 4 years ago

Test device Dell Operating System Win 10 Browser Chrome Problem description For https://github.com/phetsims/QA/issues/459 When two atoms are combined to make a molecule, they can form up at odd angles and far from each other in certain conditions. Steps to reproduce

  1. Pick out an atom and drag it outside the play area and let it return there
  2. Do the same with a second (may help to make them land on top of each other, but doesn't seem necessary)
  3. Either click the atoms if they are on top of each other or drag them together if not

Visuals separateatoms

Troubleshooting information:

!!!!! DO NOT EDIT !!!!! Name: ‪Build a Molecule‬ URL: https://phet-dev.colorado.edu/html/build-a-molecule/0.0.0-dev.23/phet/build-a-molecule_all_phet.html Version: 0.0.0-dev.23 2019-11-20 23:29:39 UTC Features missing: touch Flags: pixelRatioScaling User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 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: {}
arouinfar commented 4 years ago

I found a similar issue. However, I think the most important detail is that the first atom is dragged out of bounds.

Denz1994 commented 4 years ago

Related to #120

JRomero0613 commented 4 years ago

This happens when the atoms are placed close to the bucket area and the collection area. The atoms are placed on top of each other and a connection between the two is not made.

Denz1994 commented 4 years ago

An atom shouldn't be bonding when the atom is separating. We can use a flag to determine when an atom can be bonded and when it can't. This should be fixed in this dev version. Can you confirm @KatieWoe?

Denz1994 commented 4 years ago

This is still buggy and shouldn't be reviewed yet. The flag for separation isn't resetting properly. Self-assigning.

Denz1994 commented 4 years ago

Patch applied to Kit.canBond(). The kit now checks if the atom is contained within the play area bounds. The previous implementation was a remnant of when we were checking for an isAnimationProperty.

This dev version should have the appropriate fixes @KatieWoe.

KatieWoe commented 4 years ago

Looks good in that dev version after a quick check

Denz1994 commented 4 years ago

Nice, thanks for the check. Closing.