SpaiR / imgui-java

JNI based binding for Dear ImGui
MIT License
587 stars 90 forks source link

Bug: ImNodes pin style variables not working #163

Closed brunopj1 closed 1 year ago

brunopj1 commented 1 year ago

Version

1.86.8

What happened?

I found a couple bugs with the ImNodes pin style variables.

The first problem is that pushing ImNodesStyleVar.PinCircleRadius or ImNodesStyleVar.PinQuadSideLength doesn't do anything. Instead, the size of every pin shape is changed by pushing ImNodesStyleVar.PinTriangleSideLength.

The second problem is that changing the pin size only affects "unfilled" pin shapes. ImNodesPinShape.CircleFilled, ImNodesPinShape.TriangleFilled and ImNodesPinShape.QuadFilled keep the default size.

Reproduction

I do this at the start of the program:

ImNodes.pushStyleVar(ImNodesStyleVar.PinCircleRadius, 100.0f);
ImNodes.pushStyleVar(ImNodesStyleVar.PinQuadSideLength, 100.0f);
ImNodes.pushStyleVar(ImNodesStyleVar.PinTriangleSideLength, 10.0f);

And I do this when rendering a pin:

ImNodes.beginInputAttribute(inputPinId, ImNodesPinShape.Circle);
ImGui.dummy(0.0f, pinOffset);
ImNodes.endInputAttribute();

ImNodes.beginOutputAttribute(outputPinId, ImNodesPinShape.CircleFilled);
ImGui.dummy(0.0f, pinOffset);
ImNodes.endOutputAttribute();

Relevant log output

No response

brunopj1 commented 1 year ago

Fixed in #167