Tables: amend f799a29 with a better solution + fix potential overflow (#6140)

This commit is contained in:
ocornut
2023-02-03 22:50:43 +01:00
parent ea39841fcd
commit d6ea56dfd9
3 changed files with 11 additions and 3 deletions

View File

@ -7514,6 +7514,15 @@ ImGuiID ImGui::GetIDWithSeed(const char* str, const char* str_end, ImGuiID seed)
return id;
}
ImGuiID ImGui::GetIDWithSeed(int n, ImGuiID seed)
{
ImGuiID id = ImHashData(&n, sizeof(n), seed);
ImGuiContext& g = *GImGui;
if (g.DebugHookIdInfo == id)
DebugHookIdInfo(id, ImGuiDataType_S32, (void*)(intptr_t)n, NULL);
return id;
}
void ImGui::PopID()
{
ImGuiWindow* window = GImGui->CurrentWindow;