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

Hydrogen are not always picked up from bucket #200

Closed KatieWoe closed 4 years ago

KatieWoe commented 4 years ago

Test device Mac and Dell Operating System MacOS 10.15 and Win 10 Browser Chrome Problem description For https://github.com/phetsims/QA/issues/506. You are not always able to pick up a hydrogen atom by clicking on the bucket, rather than the atom. This tends to happen on the bottom of the bucket, and the locations it does/doesn't work change depending on the number and position of the atoms in the bucket. A bucket position may work once, but not a second time when you try to grab a second hydrogen. Haven't seen yet with other atoms, but it may be possible there. The cursor indicated that you should be able to grab, and grabbing in similar locations on other bucket works. Tends to happen under the word hydrogen, rather than above. Steps to reproduce

  1. Go to the third screen
  2. Grab a hydrogen from the bucket and put it in play area
  3. Try and grab another hydrogen by clicking the bottom area of the bucket.
  4. If able to, put hydrogen in play area and repeat until bug occurs.

Visuals hydrogeninbucket

Troubleshooting information:

!!!!! DO NOT EDIT !!!!! Name: ‪Build a Molecule‬ URL: https://phet-dev.colorado.edu/html/build-a-molecule/1.0.0-dev.75/phet/build-a-molecule_all_phet.html Version: 1.0.0-dev.75 2020-06-01 13:20:12 UTC Features missing: touch Flags: pixelRatioScaling User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.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: {}
KatieWoe commented 4 years ago

Occurs on other screens as well.

KatieWoe commented 4 years ago

Reproduced with a carbon bucket, so it does occur with other elements.

Denz1994 commented 4 years ago

In the legacy version where was a check to prevent grabbing atoms that weren't in the bucket. Specifically, if the atom was closer to the bucket but technically outside of the bucket. This was implemented before the use of the carousel and the many changes to the bucket's positioning and touch areas.

This check was being fired before the atom's drag listener was being called and it caused the dragging to bail out before anything happened on screen.

This should be fixed in this dev version. Can you verify @KatieWoe?

Denz1994 commented 4 years ago

Sorry the dev version posted didn't include the patched commit. Standby for a new dev version.

Denz1994 commented 4 years ago

Instead of bailing out immediately (in this unique case), we can select the first atom in the particle list. This way the user will still grab an atom when clicking on the bucket. Grabbing the closest atom is limited by the atom's size. Because Hydrogen is so small, we need an additional fallback.

This was also failing for Carbon buckets with 3 or more atoms. If a user left the rightmost and leftmost atoms in the bucket and clicked in the middle of the bucket (a bit lower than the text), then the atom listener would bail out.

This should be fixed in this dev version @KatieWoe.

KatieWoe commented 4 years ago

I think I'm still seeing this in the dev version

KatieWoe commented 4 years ago

Never mind. I think I was looking at the wrong version. This seems ok. I'll keep an eye out in future tests.

Denz1994 commented 4 years ago

Good to know. Closing.