phetsims / faradays-law

"Faraday's Law" is an educational simulation in HTML5, by PhET Interactive Simulations.
http://phet.colorado.edu/en/simulation/faradays-law
GNU General Public License v3.0
1 stars 7 forks source link

Dragging magnet to pan around while zoomed in causes jittery movement #197

Closed KatieWoe closed 3 years ago

KatieWoe commented 4 years ago

Test device iPad 6th Gen Operating System iPadOS 14.1 Browser Safari Problem description For https://github.com/phetsims/QA/issues/568. Fairly minor. Feel free to close if not an issue. Mostly seen on iPad/touch screen, but reproduced a bit on laptop. When the sim is zoomed in, you can drag the magnet to the edge of the screen to pan around. As you do, the magnet jitters around quite a bit.

Visuals ezgif com-gif-maker (1)

jbphet commented 4 years ago

This seems like it may well be related to #198, so I'm assigning to @jessegreenberg to investigate.

jessegreenberg commented 4 years ago

I think this can be improved. The panning that happens during keyboard drag is quite smooth and the panning during keyboard dragging, and trying to match more closely what is done there during mouse movement will be a first step.

jessegreenberg commented 4 years ago

The magnet is translated with mouse/touch position, whenever they move. When we pan the screen, the entire simulation moves under the mouse. So it creates a situation where further mouse/touch movements will make the magnet jump to the pointer because the magnet has relatively moved away from the mouse - heres another capture that

ezgif com-gif-maker (1)

jessegreenberg commented 4 years ago

I have been thinking about this one for a while and don't see a quick fix, this one will take some time. The problem is identified in https://github.com/phetsims/faradays-law/issues/197#issuecomment-724343268 - draggable things in PhET sims translate with mouse/touch movement. When we pan the entire simulation in this case, everything moves under the mouse, including the thing that is being dragged. When the mouse moves again it snaps the object to its new position. When done quickly, it looks jittery. This is not specific to faradays-law, it will happen for all draggables.

@emily-phet how important/offensive do you find this, and should we spend time now to improve this?

emily-phet commented 3 years ago

@jessegreenberg I think this is ok to leave as is for this sim.

jbphet commented 3 years ago

Marking as deferred based on @emily-phet's comment above, but leaving open so that it can be tracked and tested on a subsequent release.

jessegreenberg commented 3 years ago

OK sounds good - this is going to be a problem for all sims not just in Faradays Law so I am going to move to scenery.

jessegreenberg commented 3 years ago

Issue moved to phetsims/scenery #1125 via ZenHub