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

Improve the implementation of cue Node transformations in GrabDragInteraction #775

Open
jessegreenberg opened this issue Oct 5, 2022 · 1 comment

Comments

@jessegreenberg
Copy link
Contributor

From #447, there is a remaining piece of work:

I don't understand these linese yet. FocusOverlay uses TransformTracker for transformations up the trail, will that be sufficient since the cues are added as children to the focus highlights? Why do we need to prepend nodes matrix?

I think I understand now. The pink FocusHighlightFromNode surrounds the node's local bounds, but is added to the global coordinate frame in FocusOverlay. So likewise, the cue nodes (or children added to the focus highlights) need to be transformed by the node's local transformation matrix to be positioned correctly when transformed by the node's localToGlobalMatrix in FocusOverlay.update().

Yes this is less than ideal, and it was the cause of phetsims/friction#181. I would love to find a different solution that was more robust.

We haven't run into trouble with transforming the cue Node thus far (with 4 production usages). Perhaps we can work on it if we every run into trouble. Presumably it would be very obvious when the matrix is off (I'm sorta shrugging over here).

It would be good to improve this. We haven't had problems over several years, so it is probably low priority until we do.

@zepumph
Copy link
Member

zepumph commented Oct 6, 2022

Subset of phetsims/scenery#1298

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

3 participants