Search code examples
javaimguijava-binding

Draw end position get Item rect size


I'm trying to use ImGui (Java bindings) to fill up a empty space or fill the entire width of some UI but I can't seem to figure out how to/when to ask ImGui for the Item Rect Max and in some situations I end up with a small space that isn't filled in.

enter image description here

The code I using is here (it's too many lines to just add here) https://github.com/blockout22/VisualScripting/blob/main/src/main/java/visual/scripting/GraphWindow.java#L295

this is where I got the style from but I think I'm missing something https://github.com/thedmd/imgui-node-editor/blob/687a72f940c76cf5064e13fe55fa0408c18fcbe4/examples/blueprints-example/blueprints-example.cpp


Solution

  • I fixed this by checking for max width every time I add any new UI while creating the node

    this was my solution https://github.com/blockout22/VisualScripting/commit/7cd045efbe5366d38431ee82122a5b16f4c1e447#diff-33432afab7c91a7783be97cc24d2de52a81870145ce3a3e9dad3cb260076c208