-
Notifications
You must be signed in to change notification settings - Fork 12
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
KeyboardDragListener does not support dragBoundsProperty. #1307
Comments
Thanks! I think there is an open issue for this somewhere. Also please note that this falls under work to be done as part of #1298 (tagging it here). I couldn't find another issue in https://github.com/phetsims/scenery/issues?q=is%3Aissue+is%3Aopen+KeyboardDragListener I know this is something that @jessegreenberg and I have discussed in the past, but just didn't get enough priority (until someone wanted to use it). I was just in here recently discussing this for Friction, and I reviewed the discrepancy between DragListener.dragBoundsProperty and KeyboardDragListener's field. It shouldn't be too hard to add. |
I'm running into this again in Geometric Optics, where the rulers have dynamic drag bounds. Adding to Developer Meeting project board. |
I can tackle this now. |
@pixelzoom are you adding to dev meeting to get traction on this issue, or would you like to discuss something in particular? |
I was adding to get traction. Feel free to remove it from the project board since you're tackling it now. |
Also note that I've been mentioning this issue in TODO comment is my code, to identify sites that will need to be fixed up. |
Committed above + usages. This includes cleaning up the TODOs in GO. @pixelzoom does this look right to you in GO and any other usages you are aware of (I changed one in Fourier as well)? |
Looks great, thanks! Closing. |
Geometric Optics has dynamic drag bounds. If you resize the browser window, it makes use of the available space.
While adding alt input support in phetsims/geometric-optics#235, I discovered that KeyboardDragListener does not have the same dragBounds API as DragListener. DragListener supports dynamic drag bounds via option
{Property.<Bounds2>} dragBoundsProperty
. KeyboardDragListener has option{Bounds2} dragBounds
andset dragBounds
, so does not support a Property.I can work around this difference for Geometric Optics by adding my own listener to my dragBoundsProperty and calling KeyboardDragListener's setter when it changes. But that should be KeyboardDragListener's responsibility; KeyboardDragListener and DragListener should have the same API for dragBounds.
The text was updated successfully, but these errors were encountered: