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

GraphEditor Connection Cutting #5689

Merged
merged 3 commits into from
Mar 5, 2024

Conversation

murraystevenson
Copy link
Contributor

dragEditGadget

This was a spare-time couch experiment now tidied up into a PR. Hold X and drag to disconnect connections that intersect with the dragged line, or X and click to disconnect those under the cursor. This functionality should cover the alternate approach proposed in #788.

Implemented as a separate gadget to keep the logic out of GraphGadget. For lack of a better idea, I've named this the overly generic "DragEditGadget" as this could potentially be extended to do other things, such as create connections between nodules.

First foray into Gadget land, so suggestions are very welcome...

@tomc-cinesite
Copy link
Contributor

A-mazing!

@murraystevenson murraystevenson self-assigned this Feb 22, 2024
Copy link
Member

@johnhaddon johnhaddon left a comment

Choose a reason for hiding this comment

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

Nice one Murray! A few small comments inline, but hopefully nothing problematic...
Cheers...
John

Changes.md Outdated Show resolved Hide resolved
include/GafferUI/DragEditGadget.h Outdated Show resolved Hide resolved
src/GafferUI/DragEditGadget.cpp Outdated Show resolved Hide resolved
src/GafferUI/DragEditGadget.cpp Outdated Show resolved Hide resolved
src/GafferUI/DragEditGadget.cpp Outdated Show resolved Hide resolved
src/GafferUI/DragEditGadget.cpp Show resolved Hide resolved
@@ -726,7 +726,7 @@ void StandardNodeGadget::renderLayer( Layer layer, const Style *style, RenderRea

break;
}
case GraphLayer::Overlay :
case GraphLayer::Highlighting :
Copy link
Member

Choose a reason for hiding this comment

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

This isn't actually sufficient to stop some strikethroughs going on top of the focus gadget - because they are in the same layer, it comes down to which is drawn last. But that's the same as when they were both in the Highlighting layer, so I think that's fine...

@murraystevenson
Copy link
Contributor Author

Thanks for the input! Pushed a rebase to get Changes.md in order. Comments are addressed inline with fixups.

This gives overlays the opportunity to draw on top of the FocusGadget.
With the FocusGadget moved to render in the Highlighting layer, this change prevents another node's strikethrough from drawing on top of the FocusGadget.
@johnhaddon johnhaddon merged commit 4932b73 into GafferHQ:main Mar 5, 2024
5 checks passed
@johnhaddon
Copy link
Member

Nice one, thanks Murray! I've squashed in all your fixups and merged...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants