Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't pan during drag if an object is larger than the available screen bounds #1381

Closed
jessegreenberg opened this issue Mar 15, 2022 · 3 comments
Assignees

Comments

@jessegreenberg
Copy link
Contributor

Related to #1356, but a more specific case. If an object is larger than the available pan bounds, panning to keep it in view is awkward. The object is larger than the screen so it doesn't make sense to pan to try to keep it in view. Currently, the screen pans to try to keep the bounds minX on the left of the screen.

Here is an example of how this looks odd for very wide objects, just clicking on a wide ruler does this:
rts

I propose that if a draggable object is wider than the available screen bounds we disable panning. In this case you need to drop the object and pan to where you want to go. Otherwise, panning during drag will behave like #1365.

@jessegreenberg jessegreenberg self-assigned this Mar 15, 2022
jessegreenberg added a commit that referenced this issue Mar 15, 2022
@jessegreenberg
Copy link
Contributor Author

This seems like a pretty simple change, I am proposing it in phetsims/geometric-optics#367 to see if others agree it is acceptable.

@jessegreenberg
Copy link
Contributor Author

Behavior in phetsims/geometric-optics#367 was cleared by others on the team. Ill clean up the implementation and get it working better with alternative input (specifically KeyboardDragListener).

@jessegreenberg
Copy link
Contributor Author

In the above commits I made it so that we don't pan if the object is too large with mouse/touch. But we DO pan to the center of the object with keyboard input. It was not easy with focus to "drop" the object and drag the screen to a different area. Since dragging with focus pans to the center of the object instead however far we need to keep the object in view, this still looks and works well.

I started a dev test after changes in this issue and in #1356. But I did lots of fuzz testing with all forms of input and tested several sims manually. Closing this issue, we will finish up in #1356.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant