-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Popup graph_menu
on pin drop
#10
Comments
Yes, it'd be very useful. Would you like to work on this? |
Ah, yes. I'll try. What is your opinion for adding new trait method? I think it'd be useful to provide contextual informations such as, which node/pin is being connected. Oh; seems your comment is changed😄. I agree with creating separate method. |
And for this, it seems 'SnarlViewer::connect()' method does not return any result when invoked. This is mandatory for verifying automatic-connection validity. Is it okay to change the signature to return /// Asks the viewer to connect two pins.
///
/// This is usually happens when user drags a wire from one node's output pin to another node's input pin or vice versa.
/// By default this method connects the pins and returns `Ok(())`.
#[inline]
fn connect(&mut self, from: &OutPin, to: &InPin, snarl: &mut Snarl<T>) {
snarl.connect(from.id, to.id);
}
If logic goes this way, it seems method signature won't need to be changed. |
Result in return can be added if there will be something to do about it. UI commands should be self-contained. So one UI action should not cause multiple commands. |
Currently right clicking on the panel is the only way to add graph menu. It'd be nice to making graph menu open on dragged pin is dropped to empty space of panel. Since we can track from which node what pin is being dragged, it'd be possible to auto-connect newly created node from the menu with the node pin currently being dragged.
Pseudo code:
The text was updated successfully, but these errors were encountered: