kotlin-imgui
kotlin-imgui copied to clipboard
Make sure all Flag parameters are nullable
Ran into this problem just now: function like ImGui.treeNodeEx
which optionally take a Flag<ImGuiTreeNodeFlags>
don't currently support sending nullable flags:
val flags = (if (selected == current) ImGuiTreeNodeFlags.Selected else null) or ImGuiTreeNodeFlags.OpenOnArrow
ImGui.treeNodeEx(current.uuid(), flags, "Some node") // compile error: required Flag<ImGuiTreeNodeFlags>, found Flag<ImGuiTreeNodeFlags>?
there are a few workarounds, but since 0
is a valid Flag value, null
should be accepted anywhere