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

Any chance to zoom in/zoom out node graph? #118

Open
vtushevskiy opened this issue Aug 24, 2021 · 10 comments
Open

Any chance to zoom in/zoom out node graph? #118

vtushevskiy opened this issue Aug 24, 2021 · 10 comments
Labels
enhancement New feature or request

Comments

@vtushevskiy
Copy link

Would it be possible to implement zoom in/out for whole node graph in the editor?

@smilediver
Copy link
Contributor

I have hacked up a quick proof of concept using a suggestion noted here: ocornut/imgui#772 (comment) . It seems to work for both visual and input parts. I can work on it after I land mini-map changes.

Screenshot 2021-09-14 at 14 06 35

@Nelarius Nelarius added the enhancement New feature or request label Sep 18, 2021
@Nelarius
Copy link
Owner

Very cool @smilediver !

I don't want to have ImNodes depend on a modified ImGui version. But if there is some community-supported way of doing this, then that would be great to have documented in the repository.

@smilediver
Copy link
Contributor

It doesn't require modifications to ImGui. Basically it does two things: goes through ImNodes' draw lists and transforms the vertices; and modifies ImGui's mouse states (like ImGuiIO::MousePos) to be in the zoomed coordinate space. I just hope that ImGui doesn't have some hidden mouse states that we can't control.

@jonnygarrett
Copy link

hi @smilediver, is a (possibly beta) version of your change available anywhere ? - thanks

@smilediver
Copy link
Contributor

I think it's mostly done. I'll try to find some free time to work on it on Friday to clean it up and review, and maybe will do a PR.

@navyenzo
Copy link

did this ever get implemented?

@dyze
Copy link

dyze commented Sep 29, 2022

Hello,
Is this zoom in/out implemented? If yes, how to use it?
Thanks

@navyenzo
Copy link

Yes, any news on whether this was implemented?

the mini-map is ok, but wheel-zooming and mouse panning would be awesome

@theVerySharpFlat
Copy link

mouse panning would be awesome

Although this feature isn't implemented in the library, I was able to get this to work using EditorContextGetPanning and EditorContextResetPanning

@championAI
Copy link

Yes, any news on whether this was implemented?

the mini-map is ok, but wheel-zooming and mouse panning would be awesome

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

No branches or pull requests

8 participants