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

[Question] Is it possible to draw connections ontop the GroupingNode BG, but still behind normal Nodes? #107

Closed
hendrikp opened this issue May 14, 2024 · 6 comments
Assignees
Labels
question Further information is requested

Comments

@hendrikp
Copy link

hendrikp commented May 14, 2024

Setting on Comment/Grouping Nodes ZIndex to -2 does not have an effect on draw order. I verifed the property to be correct on the ItemContainer Parent Border. (there is a passthrough of ZIndex in the grouping node template apply function, which correctly sets the zindex)

It seems to be related to that all Nodes are grouped in the canvas behind the Connections in the VisualTree.

This setup makes it impossible to click/hover over connections inside of Grouping Nodes, except if all connections are drawn ontop all nodes (including grouping).

Is there a workaround maybe or would it require a new feature/rework?

@hendrikp hendrikp added the question Further information is requested label May 14, 2024
@miroiu
Copy link
Owner

miroiu commented May 14, 2024

Hi, this has been answered here: #71. I don't know if it is possible unless we draw the connections inside the nodes panel (which is not a good idea because the NodifyCanvas panel is meant to be fast and also calculates the extent of the nodes).

@hendrikp
Copy link
Author

Hm, maybe at least a click/hover through should be possible - ill do some experiments (i have some adjustments that make connections selectable, but as external code not in Nodify module).

Another workaround would be to draw grouping nodes in their own container before connections,

@miroiu
Copy link
Owner

miroiu commented May 14, 2024

Having a separate panel may require a significant effort because there are quite a few dependencies on the NodifyEditor.ItemsHost panel. The logic for selecting and dragging is an example.

@hendrikp
Copy link
Author

The following adjustment allows hovering/clicking connections while also making it possible to still resize/select the GroupingNode. (if you think its useful - you can use it upstream)

GroupingNode.cs#L50

                            <Grid Grid.Row="1">
                                <Grid IsHitTestVisible="False"
                                      Background="{TemplateBinding Background}">
                                    <ContentPresenter x:Name="PART_Content"
                                                      ContentSource="Content" />
                                </Grid>

                                <Thumb x:Name="PART_ResizeThumb"
                                       IsHitTestVisible="True"

@miroiu
Copy link
Owner

miroiu commented May 16, 2024

This looks like a good idea. Would you like to create a PR?

@miroiu
Copy link
Owner

miroiu commented May 25, 2024

Well, it looks like the Operation Graph from the Calculator app is not working properly with these changes because it's using a GroupingNode

@miroiu miroiu closed this as not planned Won't fix, can't repro, duplicate, stale May 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants