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

Clicking in other windows deselects nodes #22

Closed
Atrix256 opened this issue Feb 21, 2020 · 3 comments
Closed

Clicking in other windows deselects nodes #22

Atrix256 opened this issue Feb 21, 2020 · 3 comments

Comments

@Atrix256
Copy link

I have a property panel that shows info for the selected node, but whenever i click on the property panel, the selected nodes are cleared due to this code in EndNodeEditor() (like 1343)

    // check to see if the mouse was near any node
    if (g.node_hovered == INVALID_INDEX)
    {
        if (is_mouse_clicked)
        {
            editor.selected_nodes.clear();
        }
    }

Changing the if to this fixes my issue. Is this correct / should i submit a pull request?

    // check to see if the mouse was near any node
    if (g.node_hovered == INVALID_INDEX && ImGui::IsWindowHovered())
    {
        if (is_mouse_clicked)
        {
            editor.selected_nodes.clear();
        }
    }
@Nelarius
Copy link
Owner

Good catch, that's definitely an annoying issue. The change you submitted will fix it -- although you should do it for editor.selected_links as well a few lines further down in the code. If you have the change lying around still, feel free to submit a pr! 👍

@Atrix256
Copy link
Author

Atrix256 commented Feb 21, 2020 via email

Atrix256 pushed a commit to Atrix256/imnodes that referenced this issue Feb 22, 2020
The selected nodes and links are cleared no matter what window you click in.
This was a problem for me because i had a property window for selected nodes, and whenever i would click in that window to edit a property, it would unselect the node (and links).
This makes it so the click has to happen in the node editor window to cause unselection.
Fixes this issue: Nelarius#22
@Atrix256
Copy link
Author

PR submitted: #23

Nelarius pushed a commit that referenced this issue Feb 22, 2020
The selected nodes and links are cleared no matter what window you click in.
This was a problem for me because i had a property window for selected nodes, and whenever i would click in that window to edit a property, it would unselect the node (and links).
This makes it so the click has to happen in the node editor window to cause unselection.
Fixes this issue: #22
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

No branches or pull requests

2 participants