Skip to content

Commit 6d15a50

Browse files
committed
Internals: removed GetIDNoKeepAlive() now that it is the same as GetID(). (#5181)
Amend 9038678
1 parent 9038678 commit 6d15a50

File tree

3 files changed

+5
-38
lines changed

3 files changed

+5
-38
lines changed

imgui.cpp

Lines changed: 4 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3294,36 +3294,6 @@ ImGuiID ImGuiWindow::GetID(int n)
32943294
return id;
32953295
}
32963296

3297-
ImGuiID ImGuiWindow::GetIDNoKeepAlive(const char* str, const char* str_end)
3298-
{
3299-
ImGuiID seed = IDStack.back();
3300-
ImGuiID id = ImHashStr(str, str_end ? (str_end - str) : 0, seed);
3301-
ImGuiContext& g = *GImGui;
3302-
if (g.DebugHookIdInfo == id)
3303-
ImGui::DebugHookIdInfo(id, ImGuiDataType_String, str, str_end);
3304-
return id;
3305-
}
3306-
3307-
ImGuiID ImGuiWindow::GetIDNoKeepAlive(const void* ptr)
3308-
{
3309-
ImGuiID seed = IDStack.back();
3310-
ImGuiID id = ImHashData(&ptr, sizeof(void*), seed);
3311-
ImGuiContext& g = *GImGui;
3312-
if (g.DebugHookIdInfo == id)
3313-
ImGui::DebugHookIdInfo(id, ImGuiDataType_Pointer, ptr, NULL);
3314-
return id;
3315-
}
3316-
3317-
ImGuiID ImGuiWindow::GetIDNoKeepAlive(int n)
3318-
{
3319-
ImGuiID seed = IDStack.back();
3320-
ImGuiID id = ImHashData(&n, sizeof(n), seed);
3321-
ImGuiContext& g = *GImGui;
3322-
if (g.DebugHookIdInfo == id)
3323-
ImGui::DebugHookIdInfo(id, ImGuiDataType_S32, (void*)(intptr_t)n, NULL);
3324-
return id;
3325-
}
3326-
33273297
// This is only used in rare/specific situations to manufacture an ID out of nowhere.
33283298
ImGuiID ImGuiWindow::GetIDFromRectangle(const ImRect& r_abs)
33293299
{
@@ -7420,31 +7390,31 @@ void ImGui::PushID(const char* str_id)
74207390
{
74217391
ImGuiContext& g = *GImGui;
74227392
ImGuiWindow* window = g.CurrentWindow;
7423-
ImGuiID id = window->GetIDNoKeepAlive(str_id);
7393+
ImGuiID id = window->GetID(str_id);
74247394
window->IDStack.push_back(id);
74257395
}
74267396

74277397
void ImGui::PushID(const char* str_id_begin, const char* str_id_end)
74287398
{
74297399
ImGuiContext& g = *GImGui;
74307400
ImGuiWindow* window = g.CurrentWindow;
7431-
ImGuiID id = window->GetIDNoKeepAlive(str_id_begin, str_id_end);
7401+
ImGuiID id = window->GetID(str_id_begin, str_id_end);
74327402
window->IDStack.push_back(id);
74337403
}
74347404

74357405
void ImGui::PushID(const void* ptr_id)
74367406
{
74377407
ImGuiContext& g = *GImGui;
74387408
ImGuiWindow* window = g.CurrentWindow;
7439-
ImGuiID id = window->GetIDNoKeepAlive(ptr_id);
7409+
ImGuiID id = window->GetID(ptr_id);
74407410
window->IDStack.push_back(id);
74417411
}
74427412

74437413
void ImGui::PushID(int int_id)
74447414
{
74457415
ImGuiContext& g = *GImGui;
74467416
ImGuiWindow* window = g.CurrentWindow;
7447-
ImGuiID id = window->GetIDNoKeepAlive(int_id);
7417+
ImGuiID id = window->GetID(int_id);
74487418
window->IDStack.push_back(id);
74497419
}
74507420

imgui_internal.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2117,9 +2117,6 @@ struct IMGUI_API ImGuiWindow
21172117
ImGuiID GetID(const char* str, const char* str_end = NULL);
21182118
ImGuiID GetID(const void* ptr);
21192119
ImGuiID GetID(int n);
2120-
ImGuiID GetIDNoKeepAlive(const char* str, const char* str_end = NULL);
2121-
ImGuiID GetIDNoKeepAlive(const void* ptr);
2122-
ImGuiID GetIDNoKeepAlive(int n);
21232120
ImGuiID GetIDFromRectangle(const ImRect& r_abs);
21242121

21252122
// We don't use g.FontSize because the window may be != g.CurrentWidow.

imgui_widgets.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,7 @@ bool ImGui::CollapseButton(ImGuiID id, const ImVec2& pos)
856856

857857
ImGuiID ImGui::GetWindowScrollbarID(ImGuiWindow* window, ImGuiAxis axis)
858858
{
859-
return window->GetIDNoKeepAlive(axis == ImGuiAxis_X ? "#SCROLLX" : "#SCROLLY");
859+
return window->GetID(axis == ImGuiAxis_X ? "#SCROLLX" : "#SCROLLY");
860860
}
861861

862862
// Return scrollbar rectangle, must only be called for corresponding axis if window->ScrollbarX/Y is set.

0 commit comments

Comments
 (0)