MCPcopy Create free account
hub / github.com/VictorGordan/opengl-tutorials / GetIDFromRectangle

Method GetIDFromRectangle

ImGUI GLFW Tutorial/imgui/imgui.cpp:2994–3001  ·  view source on GitHub ↗

This is only used in rare/specific situations to manufacture an ID out of nowhere.

Source from the content-addressed store, hash-verified

2992
2993// This is only used in rare/specific situations to manufacture an ID out of nowhere.
2994ImGuiID ImGuiWindow::GetIDFromRectangle(const ImRect& r_abs)
2995{
2996 ImGuiID seed = IDStack.back();
2997 const int r_rel[4] = { (int)(r_abs.Min.x - Pos.x), (int)(r_abs.Min.y - Pos.y), (int)(r_abs.Max.x - Pos.x), (int)(r_abs.Max.y - Pos.y) };
2998 ImGuiID id = ImHashData(&r_rel, sizeof(r_rel), seed);
2999 ImGui::KeepAliveID(id);
3000 return id;
3001}
3002
3003static void SetCurrentWindow(ImGuiWindow* window)
3004{

Callers 2

BeginDragDropSourceMethod · 0.45
BeginDragDropTargetMethod · 0.45

Calls 1

ImHashDataFunction · 0.70

Tested by

no test coverage detected