Flix01 / imgui

Dear ImGui Addons Branch = plain unmodified dear imgui plus some extra addon.
https://github.com/Flix01/imgui/wiki/ImGui-Addons-Branch-Home
MIT License
395 stars 34 forks source link

nodegrapheditor: int-values in nodes not printed correctly #23

Closed questor closed 7 years ago

questor commented 7 years ago

Hi, thanks for your addons, they're really useful. I think I found an bug with the nodegrapheditor: when I add a int-field to a node during rendering in fieldInfo::render the precisionString is initialized with "%s" and the offset stored to the precisionLastCharIndex. For doubles, floats and so on this is changed accordingly, but not for signed/unsigned ints (it's commented out) which should be uncommented. with this fix my crash is gone.

questor commented 7 years ago

it's even a bit trickier, because internally it's converted to a float value, so you have to use "%f" also for ints in fieldinfo::render (unsigned and signed). so proper patch would be so use always "%f" at the beginning of the render function and remove the patching of the format character (because it's always "%f" now).

Flix01 commented 7 years ago

You're right: I can reproduce the bug. Basically int fields (and probably unsigned int fields) simply make the program crash.

I'll see what's the best way to fix it.

P.S. As you can see, very few people are using this addon branch, and everything that's not covered in the test demos could break something. That's why user feedback is so important. Thanks for your report!

Flix01 commented 7 years ago

Should be fixed now. Could you please check?

questor commented 7 years ago

yes, works! thanks for the fix!

Flix01 commented 7 years ago

Thanks for your feedback. Glad it worked :smiley: !