imgui-node-editor icon indicating copy to clipboard operation
imgui-node-editor copied to clipboard

Load navigation state

Open f1ymann opened this issue 3 years ago • 4 comments

Hello, sorry for bad english. I`m trying to implement save/load support for my application using imgui node editor. In functions LoadSettings and SaveSettings passed into Config object I realized configuration saving and loading, this is example of json file which I got: {"nodes":{"node:1":{"location":{"x":183,"y":56}},"node:3":{"location":{"x":209,"y":250}},"node:5":{"location":{"x":447,"y":178}}},"selection":null,"view":{"scroll":{"x":517.49993896484375,"y":244.499740600585938},"visible_rect":{"max":{"x":660.2000732421875,"y":360.599945068359375},"min":{"x":207,"y":97.7999038696289062}},"zoom":2.4999997615814209}}"} On loading this json correctly parse and settings applies for internal objects, but on next Begin I got called m_Canvas,SetView for m_NavigateAction containing default values. What can be issue? P.S. Gteat thanks for your job, this is amazing library!

f1ymann avatar Nov 03 '22 10:11 f1ymann

Thanks. Can you confirm that you're using at least version from master? Preferably from develop. There was a bug related to restoring state that was fixed recently.

thedmd avatar Nov 03 '22 12:11 thedmd

I have used latest version from master and now tried latest developer version, there is same issue

f1ymann avatar Nov 03 '22 13:11 f1ymann

Can you provide repro. Or step by step info of what functions are called and what your app do? Less guessing I have to do, better chance of fixing the issue is. : )

thedmd avatar Nov 03 '22 13:11 thedmd

I tried to create simple example showing my issue using blueprints example, but recreated imgui enviroment (library version, and windows settings) i couldnt reproduce this error. So i cut node editors part of my project and commited it here https://github.com/f1ymann/rt-test-load.git , maybe you can find what was the reason of this problem. I found that on next frame after loading node editor context from config starts handling of canvas size change and in used in NavigateAction m_NavigateAction variable m_Zoom resets to 1.

f1ymann avatar Nov 04 '22 23:11 f1ymann