MCPcopy Create free account
hub / github.com/Raais/ImStudio / BeginDragDropTargetCustom

Method BeginDragDropTargetCustom

src/third-party/imgui/imgui.cpp:11109–11130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11107}
11108
11109bool ImGui::BeginDragDropTargetCustom(const ImRect& bb, ImGuiID id)
11110{
11111 ImGuiContext& g = *GImGui;
11112 if (!g.DragDropActive)
11113 return false;
11114
11115 ImGuiWindow* window = g.CurrentWindow;
11116 ImGuiWindow* hovered_window = g.HoveredWindowUnderMovingWindow;
11117 if (hovered_window == NULL || window->RootWindow != hovered_window->RootWindow)
11118 return false;
11119 IM_ASSERT(id != 0);
11120 if (!IsMouseHoveringRect(bb.Min, bb.Max) || (id == g.DragDropPayload.SourceId))
11121 return false;
11122 if (window->SkipItems)
11123 return false;
11124
11125 IM_ASSERT(g.DragDropWithinTarget == false);
11126 g.DragDropTargetRect = bb;
11127 g.DragDropTargetId = id;
11128 g.DragDropWithinTarget = true;
11129 return true;
11130}
11131
11132// We don't use BeginDragDropTargetCustom() and duplicate its code because:
11133// 1) we use LastItemRectHoveredRect which handles items that pushes a temporarily clip rectangle in their code. Calling BeginDragDropTargetCustom(LastItemRect) would not handle them.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected