You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my application, I have custom keyboard and pointer bindings for many navigation operations. I would like to bind the + and - keys to incrementally zoom in and out the node editor, for example, and bind shift-mouse1-motion to drag the viewport. I would like to be able to set the viewport origin and zoom under control of my code rather than exclusively by pointy-clicky interaction with the node editor.
Zoom
I am aware of he GetCurrentZoom() function to read the zoom, but I can't find a corresponding SetCurrentZoom(zoom_val) or other way to change the zoom.
The implementation of GetCurrentZoom implies that I might be able to just change GetView().InvScale:
but I am using a Python binding of imgui-node-editor so I can't try that out. Is there an official API somewhere that I am missing?
Viewport position
I see the NavigateToContent() and NavigateToSelection() helpers, which look to move the viewport in specific ways, but I don't see any API to just say "place the viewport at upper_left, lower_right" or even to get the (upper_left, lower_right) of the current viewport. Internally, there's the NavigateTo action, but again I am working with a Python binding so I'm restricted to the public API.
The text was updated successfully, but these errors were encountered:
bgribble
changed the title
Manually set zoom?
Manually set zoom/position of viewport?
Jun 9, 2024
Create an invisible (empty, no padding or border) node in at the upper-left of where you want the viewport to be
Create another invisible node at the lower-right
Select them with SelectNode
NavigateToSelection()
I am still working on restoring the original selection after this navigation, but the basic concept works for adjusting the viewport position and zoom from code.
In my application, I have custom keyboard and pointer bindings for many navigation operations. I would like to bind the + and - keys to incrementally zoom in and out the node editor, for example, and bind shift-mouse1-motion to drag the viewport. I would like to be able to set the viewport origin and zoom under control of my code rather than exclusively by pointy-clicky interaction with the node editor.
Zoom
I am aware of he
GetCurrentZoom()
function to read the zoom, but I can't find a correspondingSetCurrentZoom(zoom_val)
or other way to change the zoom.The implementation of
GetCurrentZoom
implies that I might be able to just changeGetView().InvScale
:but I am using a Python binding of imgui-node-editor so I can't try that out. Is there an official API somewhere that I am missing?
Viewport position
I see the
NavigateToContent()
andNavigateToSelection()
helpers, which look to move the viewport in specific ways, but I don't see any API to just say "place the viewport at upper_left, lower_right" or even to get the (upper_left, lower_right) of the current viewport. Internally, there's theNavigateTo
action, but again I am working with a Python binding so I'm restricted to the public API.The text was updated successfully, but these errors were encountered: