|
@@ -14793,7 +14793,7 @@ const ImGuiPayload* ImGui::AcceptDragDropPayload(const char* type, ImGuiDragDrop
|
|
|
payload.Preview = was_accepted_previously;
|
|
|
flags |= (g.DragDropSourceFlags & ImGuiDragDropFlags_AcceptNoDrawDefaultRect); // Source can also inhibit the preview (useful for external sources that live for 1 frame)
|
|
|
if (!(flags & ImGuiDragDropFlags_AcceptNoDrawDefaultRect) && payload.Preview)
|
|
|
- RenderDragDropTargetRect(r, g.DragDropTargetClipRect);
|
|
|
+ RenderDragDropTargetRectForItem(r);
|
|
|
|
|
|
g.DragDropAcceptFrameCount = g.FrameCount;
|
|
|
if ((g.DragDropSourceFlags & ImGuiDragDropFlags_SourceExtern) && g.DragDropMouseButton == -1)
|
|
@@ -14809,21 +14809,26 @@ const ImGuiPayload* ImGui::AcceptDragDropPayload(const char* type, ImGuiDragDrop
|
|
|
}
|
|
|
|
|
|
// FIXME-STYLE FIXME-DRAGDROP: Settle on a proper default visuals for drop target.
|
|
|
-void ImGui::RenderDragDropTargetRect(const ImRect& bb, const ImRect& item_clip_rect)
|
|
|
+void ImGui::RenderDragDropTargetRectForItem(const ImRect& bb)
|
|
|
{
|
|
|
ImGuiContext& g = *GImGui;
|
|
|
ImGuiWindow* window = g.CurrentWindow;
|
|
|
ImRect bb_display = bb;
|
|
|
- bb_display.ClipWith(item_clip_rect); // Clip THEN expand so we have a way to visualize that target is not entirely visible.
|
|
|
+ bb_display.ClipWith(g.DragDropTargetClipRect); // Clip THEN expand so we have a way to visualize that target is not entirely visible.
|
|
|
bb_display.Expand(3.5f);
|
|
|
bool push_clip_rect = !window->ClipRect.Contains(bb_display);
|
|
|
if (push_clip_rect)
|
|
|
window->DrawList->PushClipRectFullScreen();
|
|
|
- window->DrawList->AddRect(bb_display.Min, bb_display.Max, GetColorU32(ImGuiCol_DragDropTarget), 0.0f, 0, 2.0f); // FIXME-DPI
|
|
|
+ RenderDragDropTargetRectEx(window->DrawList, bb_display);
|
|
|
if (push_clip_rect)
|
|
|
window->DrawList->PopClipRect();
|
|
|
}
|
|
|
|
|
|
+void ImGui::RenderDragDropTargetRectEx(ImDrawList* draw_list, const ImRect& bb)
|
|
|
+{
|
|
|
+ draw_list->AddRect(bb.Min, bb.Max, GetColorU32(ImGuiCol_DragDropTarget), 0.0f, 0, 2.0f); // FIXME-DPI
|
|
|
+}
|
|
|
+
|
|
|
const ImGuiPayload* ImGui::GetDragDropPayload()
|
|
|
{
|
|
|
ImGuiContext& g = *GImGui;
|