-
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
Add emitters to SimpleDragHandler #843
Comments
This doesn't need to be done for FL stable because FL will be converted to use DragListener in phetsims/faradays-law#117 |
I tried this and there's a problem. SimpleDragHandler currently has: self.phetioStartEvent( 'dragged', {
x: event.pointer.point.x,
y: event.pointer.point.y
}, HIGH_FREQUENCY_OPTIONS ); And if we convert to var HIGH_FREQUENCY_OPTIONS = {
highFrequency: true
}; How should we address this? Would the high frequency options become an Emitter phetio option? Assigned to @zepumph for discussion, but feel free to escalate to a meeting label if you think that's appropriate. |
It seems like these options need to be promoted to a phetio prefixed option, i,e: Then it should be passed to the Before we were worried about boxing us into "one type always either fully opts in or has to be completely out." Maybe we can convince ourselves that for Emitter that is ok, since Emitters only ever should be emitting for one single task, i.e. one specific phet-io event. |
It looks like the other option key in |
Sounds good.
Also, we can add that to the instanceMetadata as we did for |
Keep in mind the drag event should be high frequency. |
Graphing Quadratics should not go out until we convert this to use the new emitter pattern. Marking high priority. |
I think the "move everything to the Emitter" as exemplified in Input.js seems the cleanest (and maybe even removing the adapter methods altogether, maybe not), but I'm somewhat concerned that other developers may not like that pattern at all. Maybe we should discuss it with @jonathanolson and @pixelzoom? What do you think @zepumph? |
We are pretty heavily invested in this approach at this point, and it doesn't seem to be causing issues atm. I think we are good to proceed. Could we either (a) move the scenery logging out of the emitters in SimpleDragHandler, or (b) move logging into the emitters in PressListener. I think I prefer the first option, what do you think? |
@samreid said:
I am so out of the loop on this (I don't even know why we're adding Emitters to SImpleDragHandler) that I have nothing no feedback. |
I would like to move the entire body of |
That is a question for @jonathanolson, I feel like part of that has to do with subtyping. Note how children also have that capability. In FireListener, the value is also returned, though in DragListener it isn't used. This may not be related, but @jonathanolson why does PressListener.press return a value? EDIT:
Sure thing! |
Since the subtype "overridden" press can see whether the press succeeded or not before continuing with other behavior. Its usage is: var success = PressListener.prototype.press.call( this, event, targetNode, function() { /*...*/ } ); |
That makes sense to me, assigning to @samreid for discussion. |
@samreid said:
@zepumph said:
@pixelzoom said:
I'll create a separate issue to review our patterns for inlining/instrumenting Emitters and see if the development team has questions or feedback.
@jonathanolson are you aware of current usages of this, or is this mainly planning for potential future usage? |
@samreid said:
I fall heavily in that category. See my feedback in #928 (comment). |
I think we have a clear step forward for this issue outlined in #928 (comment). In addition it sounds like we need to keep the functionality of press's return value, so we should keep the content of pressedEmitter's callback (listener?) the way it is. |
PressListener cannot put all of the logic in the Emitters since it requires return values, so the pattern it is using now seems reasonable. Technically, we could move the logic to listener for Therefore I recommend we close this issue and continue in #928 @zepumph sound OK? |
Sounds good to me |
This will take over the events from SimpleDragHandlerIO, and we can then delete that type.
We can then uninstrument SimpleDragHandler and its sub emitters can be children of the draggable node.
The text was updated successfully, but these errors were encountered: