mirror of
https://github.com/ocornut/imgui.git
synced 2026-03-28 07:47:02 -05:00
Drag and Drop: Fixes an issue when elapsing payload would be based on last payload frame instead of last drag source frame.
This commit is contained in:
@@ -5136,7 +5136,7 @@ void ImGui::EndFrame()
|
||||
if (g.DragDropActive)
|
||||
{
|
||||
bool is_delivered = g.DragDropPayload.Delivery;
|
||||
bool is_elapsed = (g.DragDropPayload.DataFrameCount + 1 < g.FrameCount) && ((g.DragDropSourceFlags & ImGuiDragDropFlags_SourceAutoExpirePayload) || !IsMouseDown(g.DragDropMouseButton));
|
||||
bool is_elapsed = (g.DragDropSourceFrameCount + 1 < g.FrameCount) && ((g.DragDropSourceFlags & ImGuiDragDropFlags_SourceAutoExpirePayload) || !IsMouseDown(g.DragDropMouseButton));
|
||||
if (is_delivered || is_elapsed)
|
||||
ClearDragDrop();
|
||||
}
|
||||
@@ -13306,7 +13306,7 @@ bool ImGui::SetDragDropPayload(const char* type, const void* data, size_t data_s
|
||||
IM_ASSERT(strlen(type) < IM_ARRAYSIZE(payload.DataType) && "Payload type can be at most 32 characters long");
|
||||
IM_ASSERT((data != NULL && data_size > 0) || (data == NULL && data_size == 0));
|
||||
IM_ASSERT(cond == ImGuiCond_Always || cond == ImGuiCond_Once);
|
||||
IM_ASSERT(payload.SourceId != 0); // Not called between BeginDragDropSource() and EndDragDropSource()
|
||||
IM_ASSERT(payload.SourceId != 0); // Not called between BeginDragDropSource() and EndDragDropSource()
|
||||
|
||||
if (cond == ImGuiCond_Always || payload.DataFrameCount == -1)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user