thedmd / imgui-node-editor

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

BeginPin/EndPin takes space in node even if pin location is moved with PinRect #290

Closed bgribble closed 5 months ago

bgribble commented 5 months ago

In my application, I am manually positioning the pin locations using PinRect(). What I find is that no matter where I place the pins (and they do render where I wanted them) some invisible space in the node layout is occupied by them as if they were not moved.

So for instance if I have just a Text item in the node, when there are no pins the node wraps tightly around the text (with NodePadding space around it). But when I add pins after adding the text widget, even if the pins are positioned above the text, there is additional blank space added below the text. If I follow every item with a SameLine(), additional blank space is added to the right of the text widget.

thedmd commented 5 months ago

I think those blank spaces are ImGuiStyle ItemSpacing. Hard to tell in details without code. Please reopen if that wasn't the source of the issue.