Closed marlitas closed 9 months ago
Im trying to understand how the PointControllerNode works and the code related to pointController.proposePosition
.
It seems like the number line and the character are connected somehow because at particular zoom levels the scenery tries to make both the character AND the number line tick in view.
OK, so it seems like the PointControllerNode does have the character, point, and line all in one Node. The DragListener is added all of it. I think this is a good case for targetNode
of DragListener, so that DragListener (and the AnimatedPanZoomListener) can get transforms and bounds correctly for the logical "dragged Node".
This fixes both NL:I and NL:D. I went ahead and committed it. @marlitas can you please review, and anything left to verify before cherry-picking?
Thanks for the quick investigation and fix on that @jessegreenberg. This looks great and I think is ready for cherry-pick. I'll go ahead and mark as such.
It definitely pans now--sometimes it pans more than I am expecting. When zoomed in a lot, it can be hard to place objects--especially the thermometers, where I want them because the vertical panning that happens. I have to use very small mouse clicks to get it where I want it to be. If this behavior is OK, feel free to close.
I zoomed in all the way on my machine and did not find the panning to be debilitating. There are times when it was a bit annoying to place a thermometer arrow, especially when moving large distances, but I thought overall it behaved as I would expect... @amanda-phet can you test on your end and add your thoughts as well?
For the thermometer specifically, it would be a dramatic improvement to only focus on the arrow position and not the entire thermometer. If it isn't too involved, I'd like to try that. Otherwise I think it's ok to publish as-is, and be mindful of this kind of node in future sims.
@Nancy-Salpepi, @amanda-phet, and I met to discuss an approach that would change the targetNode
in panning to be just the triangle at the bottom of the thermometer. However, while this did correct the original problem and made it easier to maneuver the thermometer when a user is grabbing the bottom portion of a thermometer, it almost eliminated panning when a user is grabbing the top most part of the thermometer.
Here is a video to demonstrate:
It was decided that this was a poorer user experience overall, so we are leaving it as is.
Originally found in Number Line Operations: https://github.com/phetsims/number-line-operations/issues/108
Will need it's own implementation specific fix.