Debug Tools: ID Stack Tool: fixed using fixed-size buffers preventing long identifiers from being displayed in the tool. (#8905, #4631)

This commit is contained in:
ocornut
2025-08-26 15:36:56 +02:00
parent e728b96600
commit 783f1e62cc
3 changed files with 40 additions and 30 deletions

View File

@@ -2095,10 +2095,10 @@ struct ImGuiStackLevelInfo
ImGuiID ID;
ImS8 QueryFrameCount; // >= 1: Query in progress
bool QuerySuccess; // Obtained result from DebugHookIdInfo()
ImGuiDataType DataType : 8;
char Desc[57]; // Arbitrarily sized buffer to hold a result (FIXME: could replace Results[] with a chunk stream?) FIXME: Now that we added CTRL+C this should be fixed.
ImS8 DataType; // ImGuiDataType
int DescOffset; // -1 or offset into parent's ResultPathsBuf
ImGuiStackLevelInfo() { memset(this, 0, sizeof(*this)); }
ImGuiStackLevelInfo() { memset(this, 0, sizeof(*this)); DescOffset = -1; }
};
// State for ID Stack tool queries
@@ -2110,7 +2110,8 @@ struct ImGuiIDStackTool
ImVector<ImGuiStackLevelInfo> Results;
bool CopyToClipboardOnCtrlC;
float CopyToClipboardLastTime;
ImGuiTextBuffer ResultPathBuf;
ImGuiTextBuffer ResultPathsBuf;
ImGuiTextBuffer ResultTempBuf;
ImGuiIDStackTool() { memset(this, 0, sizeof(*this)); CopyToClipboardLastTime = -FLT_MAX; }
};