Skip to content
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

Prevents incorrect connection attempt on port clicking in GraphEdit #40112

Merged

Conversation

Chaosus
Copy link
Member

@Chaosus Chaosus commented Jul 4, 2020

This will prevent the new node dialog from the show if the user simply clicks on port:
vs_bug
Now, this dialog will show only if the user drags connection to a small distance (same for actual connection with other port):
vs_fix

Prevents incorrect connection attempt on port clicking in GraphEdit
@Chaosus Chaosus added this to the 4.0 milestone Jul 4, 2020
@Chaosus Chaosus requested a review from fire July 4, 2020 08:48
@fire
Copy link
Member

fire commented Jul 4, 2020

Will review now.

@fire
Copy link
Member

fire commented Jul 4, 2020

Blackbox testing shows that the distance drags works. Will review the code.

@@ -93,6 +93,8 @@ class GraphEdit : public Control {
String connecting_target_to;
int connecting_target_index;
bool just_disconnected;
bool connecting_valid;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In another pr initialize these variables.

Copy link
Member

@fire fire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested in Visual Script and Visual Shaders.

SWAP(from_slot, to_slot);
}
emit_signal("connection_request", from, from_slot, to, to_slot);
if (connecting_valid) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I know but the lines below 540 should also proceed in that if statement, so this prevents code duplication.

@akien-mga akien-mga merged commit e4657bd into godotengine:master Jul 4, 2020
@akien-mga
Copy link
Member

Thanks!

@Chaosus Chaosus deleted the graphedit_connection_enchancement branch July 5, 2020 05:31
BuzzBurrowes added a commit to BuzzBurrowes/godot that referenced this pull request Mar 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants