g.DragDropTargetClipRect=window->ClipRect;// May want to be overriden by user depending on use case?
g.DragDropTargetId=id;
g.DragDropWithinTarget=true;
returntrue;
}
// We don't use BeginDragDropTargetCustom() and duplicate its code because:
// 1) we use LastItemRectHoveredRect which handles items that push a temporarily clip rectangle in their code. Calling BeginDragDropTargetCustom(LastItemRect) would not handle them.
// 1) we use LastItemData's ImGuiItemStatusFlags_HoveredRect which handles items that push a temporarily clip rectangle in their code. Calling BeginDragDropTargetCustom(LastItemRect) would not handle them.
// 2) and it's faster. as this code may be very frequently called, we want to early out as fast as we can.
// Also note how the HoveredWindow test is positioned differently in both functions (in both functions we optimize for the cheapest early out case)
flags|=(g.DragDropSourceFlags&ImGuiDragDropFlags_AcceptNoDrawDefaultRect);// Source can also inhibit the preview (useful for external sources that live for 1 frame)
payload.Delivery=was_accepted_previously&&!IsMouseDown(g.DragDropMouseButton);// For extern drag sources affecting OS window focus, it's easier to just test !IsMouseDown() instead of IsMouseReleased()
ImGuiItemStatusFlags_HoveredWindow=1<<7,// Override the HoveredWindow test to allow cross-window hover testing.
ImGuiItemStatusFlags_FocusedByTabbing=1<<8,// Set when the Focusable item just got focused by Tabbing (FIXME: to be removed soon)
ImGuiItemStatusFlags_Visible=1<<9,// [WIP] Set when item is overlapping the current clipping rectangle (Used internally. Please don't use yet: API/system will change as we refactor Itemadd()).
ImGuiItemStatusFlags_HasClipRect=1<<10,// g.LastItemData.ClipRect is valid
// Additional status + semantic for ImGuiTestEngine
#ifdef IMGUI_ENABLE_TEST_ENGINE
@ -1221,7 +1222,9 @@ struct ImGuiLastItemData
ImGuiItemStatusFlagsStatusFlags;// See ImGuiItemStatusFlags_