thedmd / imgui-node-editor

Node Editor built using Dear ImGui
MIT License
3.64k stars 537 forks source link

[Bug] Weird canvas display after zooming #260

Closed adepierre closed 11 months ago

adepierre commented 1 year ago

With latest version, canvas centering is broken when zooming. Instead of taking the whole area, the canvas shrinks with black borders around. I think the faulty commit is 6e662a4f61f8fae439026908e5f76155d91c5dcb but I'm not sure why. Automatic "fit to content" with F is also not correct, with extreme zoom level.

Imgui version tested with: 1.89.9

image

image

w0utert commented 12 months ago

Same for me. I'm extremely glad I found this issue because I was almost set to go on an epic debug quest to find out how my own DPI/mouse scaling code would be broken. I'm using an ImGui 1.89-WIP snapshot from master with Vulkan backend.

imgui-node-editor v0.9.2-stable works fine so I've reverted to that for now.

thedmd commented 11 months ago

I tried to reproduce with latest ImGui but without luck. Can you @adepierre or you @w0utert provide a way to reproduce that behavior?

adepierre commented 11 months ago

I tried to make a small standalone cmake project to reproduce the error. It's using imgui 1.89.9 and node editor master branch 084736a. To reproduce: launch the repro project, zoom/unzoom/press F.

repro.zip

thedmd commented 11 months ago

Thank you very much. It is fixed now on master and develop