MCPcopy Create free account
hub / github.com/Aegel5/SimpleSwitcher / GetIDFromPos

Method GetIDFromPos

imgui_tiny_app/imgui/imgui.cpp:9823–9829  ·  view source on GitHub ↗

This is only used in rare/specific situations to manufacture an ID out of nowhere. FIXME: Consider instead storing last non-zero ID + count of successive zero-ID, and combine those?

Source from the content-addressed store, hash-verified

9821// This is only used in rare/specific situations to manufacture an ID out of nowhere.
9822// FIXME: Consider instead storing last non-zero ID + count of successive zero-ID, and combine those?
9823ImGuiID ImGuiWindow::GetIDFromPos(const ImVec2& p_abs)
9824{
9825 ImGuiID seed = IDStack.back();
9826 ImVec2 p_rel = ImGui::WindowPosAbsToRel(this, p_abs);
9827 ImGuiID id = ImHashData(&p_rel, sizeof(p_rel), seed);
9828 return id;
9829}
9830
9831// "
9832ImGuiID ImGuiWindow::GetIDFromRectangle(const ImRect& r_abs)

Callers 1

IsItemHoveredMethod · 0.80

Calls 2

WindowPosAbsToRelFunction · 0.85
ImHashDataFunction · 0.85

Tested by

no test coverage detected