Closed Nancy-Salpepi closed 2 years ago
I also reproduced this on Chromebook.
I think this should be fixed, and I suspect that it won't be trivial. Even though this exists in the published sim (as @Nancy-Salpepi noted above), I think we should fix it, primarily because the behavior occurs if you pick up the balloon using keyboard nav and then move it using the shift+arrow keys. Not good.
I have a fix that seems to work reasonably well for this, which is to reduce the threshold for the minimum speed at which the balloon picks up changes to any value above zero. This make me a little nervous though, because I'm not sure why a threshold was used in the first place. I went through the history of the file, and as far as I can tell, the threshold was pretty much always there and was not added to address any particular issue.
Here's a patch with the proposed change:
I've decided to go ahead and commit the change described in the previous comment. I did a fair bit of local testing and didn't see any regressions, and also fuzz tested for a few minutes.
@Nancy-Salpepi - Can you please test this on master and verify that it's fixed and that you don't notice any odd side effects? I'd just like to get another pair of eyes on this before I decide for sure whether this is a reasonable fix.
For the record, it was bothering me that the charges are being picked up based on the rectangular bounds of the balloon image and not something shaped more like the balloon, such as an ellipse, so I looked at the code that tests this. There was an explanation in a comment that said the rectangular bounds were used for performance reasons, and it referenced https://github.com/phetsims/balloons-and-static-electricity/issues/409.
This somewhat odd behavior is pretty noticeable when moving the balloon really slowly, so I found it very apparent when testing changes that were made for this issue, but I have to say that I had never really noticed it before working on this. In the end, that probably implies that it's not really much of a problem.
Works great @jbphet!
Cool. Unassigning, and will have this verified in the upcoming RC.
Tested on the iPad and on the MacBook air. Looks good.
@jbphet I do see what you are saying in the above comment https://github.com/phetsims/balloons-and-static-electricity/issues/526#issuecomment-904923198
It was bothering me and then I remembered that you had also commented on it. In the video below it seems odd to me that the electrons closest to the balloon are not being picked up first.
@Nancy-Salpepi said:
@jbphet I do see what you are saying in the above comment #526 (comment)
It was bothering me and then I remembered that you had also commented on it. In the video below it seems odd to me that the electrons closest to the balloon are not being picked up first.
I looked at the code, and it would be a big lift to change this at this point in time. It's a bit more noticeable now that very slow motion will pick up electrons, but the balloons in this sim have always picked up charges in this way, and we haven't yet found it necessary to change it so far. In my opinion it doesn't seem too problematic, and in the vast majority of cases people won't be moving the balloon this slowly. So, I'm not going to pursue changes to this behavior, and I don't think it's even worth asking the design team at this point.
@Nancy-Salpepi also said:
Works great @jbphet!
So, based on this, I'm going to close.
Test device MacBook Air (M1 chip)
Operating System 11.4
Browser Seen on both safari and chrome. Can also be reproduced using iPad + safari.
Problem description https://github.com/phetsims/qa/issues/689
When the balloon is moved slowly over the sweater, negative charges are not picked up.
Steps to reproduce
I do notice that this occurs in published sim as well.
Visuals https://drive.google.com/file/d/1Fw5_RPW3rhOOH5vt6MwWwVfKX19_sZ5A/view?usp=sharing https://drive.google.com/file/d/1jFPf06UuHFnqILTu912oP2vxbm5501lP/view?usp=sharing
Troubleshooting information: !!!!! DO NOT EDIT !!!!! Name: Balloons and Static Electricity URL: https://phet-dev.colorado.edu/html/balloons-and-static-electricity/1.5.0-dev.35/phet/balloons-and-static-electricity_all_phet.html Version: 1.5.0-dev.35 2021-08-06 21:46:41 UTC Features missing: applicationcache, applicationcache, touch Flags: pixelRatioScaling User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36 Language: en-US Window: 1440x693 Pixel Ratio: 2/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: 80) Max viewport: 16384x16384 OES_texture_float: true Dependencies JSON: {}