mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-11 00:04:24 +00:00
Internals: extracted ImHashSkipUncontributingPrefix() out of CreateNewWindowSettings() and added note about it.
This commit is contained in:
parent
9e864012ae
commit
75a4a48d1f
2 changed files with 11 additions and 6 deletions
16
imgui.cpp
16
imgui.cpp
|
|
@ -2387,6 +2387,14 @@ ImGuiID ImHashStr(const char* data_p, size_t data_size, ImGuiID seed)
|
||||||
return ~crc;
|
return ~crc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Skip to the "###" marker if any. We don't skip past to match the behavior of GetID()
|
||||||
|
const char* ImHashSkipUncontributingPrefix(const char* label)
|
||||||
|
{
|
||||||
|
if (const char* p = strstr(label, "###")) // FIXME: Should loop.
|
||||||
|
label = p;
|
||||||
|
return label;
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// [SECTION] MISC HELPERS/UTILITIES (File functions)
|
// [SECTION] MISC HELPERS/UTILITIES (File functions)
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
@ -15259,13 +15267,9 @@ ImGuiWindowSettings* ImGui::CreateNewWindowSettings(const char* name)
|
||||||
{
|
{
|
||||||
ImGuiContext& g = *GImGui;
|
ImGuiContext& g = *GImGui;
|
||||||
|
|
||||||
|
// Preserve the full string when ConfigDebugVerboseIniSettings is set to make .ini inspection easier.
|
||||||
if (g.IO.ConfigDebugIniSettings == false)
|
if (g.IO.ConfigDebugIniSettings == false)
|
||||||
{
|
name = ImHashSkipUncontributingPrefix(name);
|
||||||
// Skip to the "###" marker if any. We don't skip past to match the behavior of GetID()
|
|
||||||
// Preserve the full string when ConfigDebugVerboseIniSettings is set to make .ini inspection easier.
|
|
||||||
if (const char* p = strstr(name, "###"))
|
|
||||||
name = p;
|
|
||||||
}
|
|
||||||
const size_t name_len = ImStrlen(name);
|
const size_t name_len = ImStrlen(name);
|
||||||
|
|
||||||
// Allocate chunk
|
// Allocate chunk
|
||||||
|
|
|
||||||
|
|
@ -367,6 +367,7 @@ extern IMGUI_API ImGuiContext* GImGui; // Current implicit context pointer
|
||||||
// Helpers: Hashing
|
// Helpers: Hashing
|
||||||
IMGUI_API ImGuiID ImHashData(const void* data, size_t data_size, ImGuiID seed = 0);
|
IMGUI_API ImGuiID ImHashData(const void* data, size_t data_size, ImGuiID seed = 0);
|
||||||
IMGUI_API ImGuiID ImHashStr(const char* data, size_t data_size = 0, ImGuiID seed = 0);
|
IMGUI_API ImGuiID ImHashStr(const char* data, size_t data_size = 0, ImGuiID seed = 0);
|
||||||
|
IMGUI_API const char* ImHashSkipUncontributingPrefix(const char* label);
|
||||||
|
|
||||||
// Helpers: Sorting
|
// Helpers: Sorting
|
||||||
#ifndef ImQsort
|
#ifndef ImQsort
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue