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

AnimatedPanZoomListener doesn't keep the Node in view during drag in cases of event forwarding #1321

Closed
jessegreenberg opened this issue Nov 16, 2021 · 6 comments
Assignees

Comments

@jessegreenberg
Copy link
Contributor

Noticed in phetsims/equality-explorer#179.

The AnimatedPanZoomListener uses the Trail to the target of a down event to determine which Node should remain in view when dragging. That Trail is not the one we want to track when event is forwarded to another target with the creator pattern.

In general I don't think we should be using the Trail of the down event to accomplish this with the AnimatedPanZoomListener. I don't see any good way from Event or Pointer to retrieve the right Trail of the "grabbed" Node to keep it in view.

I am almost wondering about changing the behavior slightly to pan whenever the Pointer is near the edge of screen bounds and not make it based on whether the Node is out of view at all.

@Nancy-Salpepi
Copy link

Nancy-Salpepi commented Nov 17, 2021

Hey @jessegreenberg
Looking at your comment phetsims/equality-explorer#179 (comment), I would expect panning to work when moving an object that isn't coming from a toolbar. However, while testing phetsims/qa#738, the screen does not pan when I move a block.

(Using Mac OS 12.0.1 + chrome)

panningdensity
.

@jessegreenberg
Copy link
Contributor Author

Ah, thanks @Nancy-Salpepi, Ill take a look at that case as well and see what is different. If I proceed with

I am almost wondering about changing the behavior slightly to pan whenever the Pointer is near the edge of screen bounds and not make it based on whether the Node is out of view at all.

I suspect it will fix all of these anyway.

@KatieWoe
Copy link

I also noticed that automatic panning may happen in phetsims/qa#738 when it isn't intended.

IMG_0084.MP4

@KatieWoe
Copy link

The above also happens from the bottom of the pool scrolling up.

@KatieWoe
Copy link

Noting this in phetsims/qa#751

@jessegreenberg
Copy link
Contributor Author

This issue was replaced by #1558 which is complete. Closing this one as well.

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

No branches or pull requests

4 participants