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

Mouse Position in Grid Space? #206

Open
michaelquigley opened this issue Feb 20, 2025 · 2 comments
Open

Mouse Position in Grid Space? #206

michaelquigley opened this issue Feb 20, 2025 · 2 comments

Comments

@michaelquigley
Copy link

Is there any way to get the current mouse position in grid space? I'm trying to add a node under the mouse cursor, but I'm not sure there is currently any way to convert arbitrary screen space coordinates to grid space.

@bryanbendall
Copy link

I do this in my program. First I get the mouse position with ImGui::GetMousePosOnOpeningCurrentPopup(), I'm adding from a popup menu. Then I add the node and after set the position with ImNodes::SetNodeScreenSpacePos(). Hope that helps.

@michaelquigley
Copy link
Author

Unfortunately it doesn't help. In order to work with the structure of my software, I need to be able to ask imnodes to translate between screen space and grid space without inserting a node.

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