Skip to content

[Bug]: STB_TexteditState not properly exported #123

Description

@wolfcomp

Pre-submission Checklist

  • I have read the FAQ Wiki
  • I have searched existing issues and this is not a duplicate
  • I am using the latest version of Hexa.NET.ImGui

Hexa.NET.ImGui Version

1.91.9b

Bug Description

References to STB_TexteditState result in an empty struct. The actual compiled DLL has a full STB_TexteditState struct that isn't exported.

Steps to Reproduce

  1. Try to use ImGuiInputTextStatePtr or ImGuiInputTextState* where you try to access Stb.SelectStart (offset 0x4 from struct start of STB_TexteditState)

Expected Behavior

Stb.SelectStart, Stb.SelectEnd, Stb.Cursor is accessible.

Code Sample

public static void SanitizeSelectionRange(this ImGuiInputTextStatePtr self)
{
    ref var s = ref self.Stb.SelectStart;
    ref var e = ref self.Stb.SelectEnd;
    ref var c = ref self.Stb.Cursor;
    s = Math.Clamp(s, 0, self.TextLen);
    e = Math.Clamp(e, 0, self.TextLen);
    c = Math.Clamp(c, 0, self.TextLen);
    if (s == e)
        s = e = c;
    if (s > e)
        (s, e) = (e, s);
}

Platform

Windows

.NET Version

.net 10

Additional Context

https://github.com/ocornut/imgui/blob/v1.91.9b-docking/imstb_textedit.h#L329-L365 is not exported to https://github.com/JunaMeinhold/cimgui/blob/docking_inter/cimgui.h#L2119-L2120

Possbily an upstream issue due to fork: https://github.com/cimgui/cimgui/blob/docking_inter/cimgui.h#L2129-L2130

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions