ImGui.NET icon indicating copy to clipboard operation
ImGui.NET copied to clipboard

ImGui.GetStyleColorVec4 returns a pointer

Open Marlax0 opened this issue 3 years ago • 1 comments

Example (unsafe context):

Vector4* textColor = ImGui.GetStyleColorVec4(ImGuiCol.Text);

ImGui.PushStyleColor(ImGuiCol.Text, *textColor);

This doesn't seem to be intentional.

Using 1.87.3 via NuGet.

Marlax0 avatar Apr 06 '22 20:04 Marlax0

Unfortunately, it kind-of does seem to be expected based on the native definition: https://github.com/ocornut/imgui/blob/92d0924b82dcc1c7159977d29a9c5044ff85459d/imgui.h#L422

It returns a reference (supposed to be const) to the portion of the style structure for the given color type. What you're doing above should work just fine, but it's not a great way to expose this functionality.

mellinoe avatar Jul 07 '22 03:07 mellinoe