Draw over window frame?

I’m trying to use dear imgui to create a node based interface, and I’d like to draw the “sockets” overlapping the node edges (ala blender):

image

It seems that drawings with drawlist->AddCircleFilled(…) are clipped to within the window:

image

Using the foreground drawlist would make sockets on background “nodes” (ImGui windows) appear above overlapping windows, which I’d prefer to avoid.

Is there a way to do this?

You can use PushClipRect() to alter the clipping rectangle.

Or you can create your window with zero WindowPadding using PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0,0)); Begin(...); PopStyleVar();
By default the clipping rectangle is padded with half of style.WindowPadding on the top and left sides(The reason why it is 0.5*WindowPadding and not 1.0*WindowPadding is a little specific and not the point here).

1 Like