phetsims / build-a-nucleus

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

Difficult to place particle on third energy level #194

Closed Nancy-Salpepi closed 1 year ago

Nancy-Salpepi commented 1 year ago

Test device MacBook Air M1 chip

Operating System 13.5.1

Browser Safari 16.6

Problem description For https://github.com/phetsims/qa/issues/977, on the Chart Intro screen when manually placing a neutron (or proton) on the third energy level, if I let go above the level it drops back to the collection area rather than falling to the third energy level. I don't see this same behavior with the first or second energy level.

Steps to reproduce

  1. Press the Add Proton + Neutron button 8 times to fill the first 2 energy levels
  2. Grab a neutron (or proton) and release it slightly above the third energy level

Visuals

https://github.com/phetsims/build-a-nucleus/assets/87318828/710bb0cc-b422-4939-b6e2-86a41268e910

Troubleshooting information: !!!!! DO NOT EDIT !!!!! Name: ‪Build a Nucleus‬ URL: https://phet-dev.colorado.edu/html/build-a-nucleus/1.0.0-dev.23/phet/build-a-nucleus_all_phet.html Version: 1.0.0-dev.23 2023-09-12 15:57:17 UTC Features missing: applicationcache, applicationcache, touch Flags: pixelRatioScaling User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Safari/605.1.15 Language: en-US Window: 1317x706 Pixel Ratio: 2/1 WebGL: WebGL 1.0 GLSL: WebGL GLSL ES 1.0 (1.0) Vendor: WebKit (WebKit WebGL) Vertex: attribs: 16 varying: 30 uniform: 1024 Texture: size: 16384 imageUnits: 16 (vertex: 16, combined: 32) Max viewport: 16384x16384 OES_texture_float: true Dependencies JSON: {}
zepumph commented 1 year ago

@Luisav1, we have talked about this in the past. It is because the origin of particles is in the top left right? I feel like the dilation on the bottom side is not like this. We likely want to dilate some checking logic to account for an extra diameter on the top of the ShellNucleus lines.

KatieWoe commented 1 year ago

I was running in to this as well.

zepumph commented 1 year ago

I plotted the view bounds of the modelViewTransform, and things look REALLY great:

https://github.com/phetsims/build-a-nucleus/blob/f13d1442601da590917b2eaf02b6f0ba5709530e/js/chart-intro/model/ShellModelNucleus.ts#L50-L53

image

So this is more about the capture area logic when releasing mouse drag. I'll take a look.

zepumph commented 1 year ago

This is the new capture area:

image

@Nancy-Salpepi will you review main and feel free to close.

Nancy-Salpepi commented 1 year ago

@zepumph it is definitely better, but maybe the capture area still needs to be a teensy bit higher? @KatieWoe what do you think?

https://github.com/phetsims/build-a-nucleus/assets/87318828/82a952fe-1d97-4bcc-8cb1-853285b0261e

KatieWoe commented 1 year ago

It seemed ok to me using a mouse.

zepumph commented 1 year ago

Makes sense to me, here is another particle-radius's worth of increase. What do you think?

Nancy-Salpepi commented 1 year ago

Thanks @zepumph! I like it!