-
Notifications
You must be signed in to change notification settings - Fork 13
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
should the tracer tool be draggable by its probe? #141
Comments
@pixelzoom I really like this suggestion! It does seem like a natural place to drag the tool, so please go ahead and make this change @andrea-phet. |
@andrea-phet somewhat related to this, in TracerNode: 111 // @public Should be added as a listener by our parent when the time is right
112 this.movableDragHandler = new MovableDragHandler( tracer.positionProperty, {
...
123 // When dragging, move the tracer tool
124 rectangle.addInputListener( this.movableDragHandler ); The comment on line 111 seems incorrect. The listener is added on line 124, and |
Here's the patch to implement this. Deltas are indicated by + and - in the leftmost column.
|
Oh, thanks @pixelzoom I didn't see your comment until after the commit above. |
Assigning to @arouinfar to review. |
👍 |
Reopening. Works great, but the implementation is a little non-standard. Since the entire TracerNode is now draggable, it would be preferable to (1) add the drag handler to the entire node (after |
It's also unnecessary to set |
There's just one thing: the halo that highlights the dot that the tracer tool is on is a child of TracerNode. I don't want that draggable, which is why I only pick circle and rectangle to drag. |
If you want to be totally safe and independent of rendering order, set |
Oh yeah, good point. |
Looks great. I restored the |
Okay, closing. |
Discovered while making the screenshot shown in #135 (comment).
I tried to drag the tracer tool by it's probe, which I think is a natural thing to do if you want to put the probe on a specific location. But I discovered that you can only move it by dragging the body of the tool.
In case I have the terminology wrong, this is what the code refers to as the tracer tool:
The text was updated successfully, but these errors were encountered: