From d810ce70eabbf630c760743f8cb4b6ca437b4d19 Mon Sep 17 00:00:00 2001 From: shweet Date: Tue, 18 Nov 2025 01:17:42 -0500 Subject: [PATCH] fix dragging frames and moving --- src/imgui/window/timeline.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/imgui/window/timeline.cpp b/src/imgui/window/timeline.cpp index 0cb80fb..ef9577b 100644 --- a/src/imgui/window/timeline.cpp +++ b/src/imgui/window/timeline.cpp @@ -825,12 +825,12 @@ namespace anm2ed::imgui if (type != anm2::TRIGGER) { - if (ImGui::BeginDragDropSource(ImGuiDragDropFlags_SourceNoPreviewTooltip)) - { - frameDragDrop = {}; - frameDragDrop.type = type; - frameDragDrop.itemID = id; - frameDragDrop.animationIndex = reference.animationIndex; + if (!draggedFrame && ImGui::BeginDragDropSource(ImGuiDragDropFlags_SourceNoPreviewTooltip)) + { + frameDragDrop = {}; + frameDragDrop.type = type; + frameDragDrop.itemID = id; + frameDragDrop.animationIndex = reference.animationIndex; auto append_valid_indices = [&](const auto& container) { @@ -870,8 +870,8 @@ namespace anm2ed::imgui ImGui::EndDragDropSource(); } - if (ImGui::BeginDragDropTarget()) - { + if (!draggedFrame && ImGui::BeginDragDropTarget()) + { if (auto payload = ImGui::AcceptDragDropPayload(FRAME_DRAG_PAYLOAD_ID)) { auto source = static_cast(payload->Data);