phetsims / geometric-optics

Geometric Optics is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
6 stars 5 forks source link

Should the screen pan when you jump objects to new positions? #471

Closed KatieWoe closed 1 year ago

KatieWoe commented 1 year ago

Device Samsung OS Win 11 Browser Chrome Problem Description For https://github.com/phetsims/qa/issues/947 When zoomed in, should the "camera" follow an object if you move it with the J command?

https://github.com/phetsims/geometric-optics/assets/41024075/7e76f207-d2eb-4a04-a8a3-49f1acc9d9dc

From Slack:

Amy Rouinfar I think the behavior is fine, but it's contrary to what I know about panning. I thought it's supposed to pan to keep the focused object in view, but maybe that's only when focusing on a new object and not following an already-focused object Kathryn Woessner It pans if you move it with the arrows Chris Malley Maybe ask Jesse? I’m not sure what the desired behavior is. But I do no the sim does not control it, it’s common code. Jesse Greenberg I can't really find anything. Its something we could do, but I am not sure if we should. Can you please open an issue and assign to the responsible designer?

@Nancy-Salpepi mentioned that she remembers a similar discussion for Balloons and Static Electricity.

jessegreenberg commented 1 year ago

@KatieWoe @Nancy-Salpepi thanks for pointing out that this is the behavior in BASE. Id like to understand why this behavior exists in BASE but not geometric-optics.

jessegreenberg commented 1 year ago

So it behaves this way accidentally in BASE because of overlap with the W and S keys. In BASE there are "J+W" and "J+S" hotkeys. The KeyboardDragListener attaches to a Pointer when when one of the WASD keys are pressed. The AnimatedPanZoomListener sees the attached listener for dragging and then pans so that the balloon is at the center of the screen. There is no panning in BASE with "J+C" (jump to center) command because "C" is not a key that the KeyboardDragListener cares about.

We should get this behaving better, Ill make a new issue in scenery. @pixelzoom I would recommend checking with design team to see if this blocks publication of 1.3. My recommendation is that it should not, this issue is not new to 1.3 and exists in 1.1.

arouinfar commented 1 year ago

Thanks @jessegreenberg. The scenery fix sounds like a nice improvement for the future, and I agree that it doesn't block Geometric Optics.

pixelzoom commented 1 year ago

Agreed, let's not do this for Geometric Optics 1.3. When https://github.com/phetsims/scenery/issues/1558 is fixed, we'll pick that up in a future release.

Closing as "won't fix".