-
Notifications
You must be signed in to change notification settings - Fork 414
Making children of node drag along with parent #200
Comments
Its called here: |
@Seneral Thanks so much for such a quick and informative reply. I realized early on that I didn't have much of a use for the NodeGroups, so I didn't do much research into them, and turns out the I used recursion since I don't just want a node's children to be dragged along, I want the whole subtree. Here's the code I wrote inside of my
|
Looking good, just one thing, I'd expect ypu need to change at least the drag id from "node" to something custom so the default mouseDrag events won't interfere. Right now it seems it will come down to chance which one will get called first, at least from a quick glance. Having a different drag id means the builtin function will not consider it as a drag it needs to handle. Also make sure all your relevant canvas types are disallowing loops (via property) if you are relying on recursion like this, especially if you intend to have other users use the system. |
Yeah, good point, I was wondering if that would cause an issue. In testing so far, it never seemed like the default mouseDrag events ever activated, I think perhaps because I set the priority of the EventHandlerAttribute to a lesser value, but it definitely would be good to change it to something unique. And yeah, I never disallowed recursive loops, I just knew I wasn't going to be using them. How should I do that? Maybe in |
Nevermind, |
Hey, I'm trying to modify the code so that when I move one node, any children of that node are dragged by the same amount.
I created an extension class to
NodeEditorCallbackReceiver
and overrided theOnMoveNode(Node node)
method. However, my code isn't working, and the Debug print statement I put in that function never does anything, so I know the method is not being called. I also noticed that theNodeEditorCallbacks
class has a staticAction<Node>
for each of the node callbacks. I tried setting this value inOnEnable()
in my class, but still, no effect.What am I missing here?
The text was updated successfully, but these errors were encountered: