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

Pan-and-Zoom feature is not working with PhET "Creator" pattern. #769

Closed
pixelzoom opened this issue Nov 17, 2021 · 11 comments
Closed

Pan-and-Zoom feature is not working with PhET "Creator" pattern. #769

pixelzoom opened this issue Nov 17, 2021 · 11 comments
Assignees
Labels

Comments

@pixelzoom
Copy link
Contributor

pixelzoom commented Nov 17, 2021

Creator is a PhET design pattern used by toolboxes and buckets. When something is dragged out of a toolbox or bucket, a new object is created, with a corresponding model and view. As discovered in phetsims/equality-explorer#179 (comment), if the simulation is zoomed in, then panning does not work while dragging the newly-created object.

In phetsims/equality-explorer#179 (comment), @jessegreenberg confirmed that this is a general problem, and said:

I would have expected it to keep the Node in view here. Pan and Zoom is not handling the creator pattern well, that is why it doesn't work when you pull out a term from the toolbar but does work for subsequent drags. It is not sim specific. ...

In phetsims/equality-explorer#179 (comment), @KatieWoe also confirmed that this is a general problem, occuring in "a number of sims on master" and "is in phetsims/qa#736 as well".

Assigned to @jessegreenberg to investigate. Please check with @kathy-phet and @amanda-phet for priority.

@pixelzoom
Copy link
Contributor Author

From phetsims/equality-explorer#179 (comment), this shows the buggy behavior:

pandragobjects

@pixelzoom pixelzoom changed the title Pan feature is not working with PhET "Creator" pattern. Pan-and-Zoom feature is not working with PhET "Creator" pattern. Nov 17, 2021
@amanda-phet amanda-phet removed their assignment Nov 18, 2021
@KatieWoe
Copy link

KatieWoe commented Dec 3, 2021

Noting in phetsims/qa#748

@pixelzoom
Copy link
Contributor Author

This will likely be a problem for geometric-optics, where we drag rulers out of a toolbox.

@Nancy-Salpepi
Copy link

Nancy-Salpepi commented Feb 1, 2022

When testing phetsims/qa#771, I noticed that pan-and-zoom works when moving an object around the play area. However, if I were to remove an object from a grouping, it will not pan until I release it and grab it again. Also, panning won't happen when an object is initially removed from bucket.

panningNP

@jessegreenberg
Copy link
Contributor

jessegreenberg commented Feb 10, 2022

The overall approach to panning while dragging an object is pretty poor. I am going to reconsider it here first phetsims/scenery#1356 before trying to get what we currently have working with the "Creator" pattern.

@Nancy-Salpepi
Copy link

Noting that I'm seeing this issue while testing phetsims/qa#785.
For example, panning doesn't occur after removing an element from the carousel in CCK .

@samreid
Copy link
Member

samreid commented Apr 12, 2023

@jessegreenberg can you please comment on the state of this issue now that phetsims/scenery#1356 is closed?

@jessegreenberg
Copy link
Contributor

I just confirmed that cases like phetsims/build-a-nucleus#23 are not fixed so we still need to solve that. But hopefully it will be easier now that phetsims/scenery#1356 is done.

@Luisav1
Copy link
Contributor

Luisav1 commented Jul 7, 2023

Build a Nucleus is getting ready for publication, it'd be nice to take a look at this issue. @jessegreenberg, @zepumph and I would be happy to help.

@jessegreenberg
Copy link
Contributor

jessegreenberg commented Jul 12, 2023

Pan and zoom is working well in BAN with changes from phetsims/scenery#1356 once the targetNode is set on the DragListener for the forwarded event. I will see if that is the case for CCK as well (#769 (comment))

@jessegreenberg
Copy link
Contributor

The issue in CCK is caused by phetsims/circuit-construction-kit-common#992, a sim specific issue. Since this pattern has been well supported for a while and the remaining sim specific cases are handled, this issue can be closed.

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

No branches or pull requests

8 participants