From 4b6fa7153df593de9a4fd6b68ac85d0a81213b9f Mon Sep 17 00:00:00 2001 From: shweet Date: Fri, 14 Nov 2025 16:22:22 -0500 Subject: [PATCH] quck fixes to issues i noticed while doing a general overview --- src/imgui/documents.cpp | 3 +-- src/imgui/taskbar.cpp | 6 ++++-- src/imgui/window/animation_preview.cpp | 6 ++++-- src/imgui/window/timeline.cpp | 1 - src/state.cpp | 5 ++++- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/imgui/documents.cpp b/src/imgui/documents.cpp index 5c45a5a..6af9d40 100644 --- a/src/imgui/documents.cpp +++ b/src/imgui/documents.cpp @@ -175,7 +175,6 @@ namespace anm2ed::imgui { if (!manager.anm2DragDropPopup.is_open()) manager.anm2DragDropPopup.open(); - bool wasOpen = manager.anm2DragDropPopup.is_open(); manager.anm2DragDropPopup.trigger(); if (ImGui::BeginPopupContextWindow(manager.anm2DragDropPopup.label, ImGuiPopupFlags_None)) @@ -212,7 +211,7 @@ namespace anm2ed::imgui manager.anm2DragDropPopup.end(); ImGui::EndPopup(); } - else if (wasOpen && !manager.anm2DragDropPopup.is_open()) + else if (!ImGui::IsPopupOpen(manager.anm2DragDropPopup.label)) drag_drop_reset(); } } diff --git a/src/imgui/taskbar.cpp b/src/imgui/taskbar.cpp index 49d9ab2..73f6033 100644 --- a/src/imgui/taskbar.cpp +++ b/src/imgui/taskbar.cpp @@ -909,8 +909,10 @@ namespace anm2ed::imgui if (shortcut(manager.chords[SHORTCUT_OPEN], shortcut::GLOBAL)) dialog.file_open(dialog::ANM2_OPEN); if (shortcut(manager.chords[SHORTCUT_SAVE], shortcut::GLOBAL)) { - if (settings.fileIsWarnOverwrite) overwritePopup.open(); - manager.save(); + if (settings.fileIsWarnOverwrite) + overwritePopup.open(); + else + manager.save(); } if (shortcut(manager.chords[SHORTCUT_SAVE_AS], shortcut::GLOBAL)) dialog.file_save(dialog::ANM2_SAVE); if (shortcut(manager.chords[SHORTCUT_EXIT], shortcut::GLOBAL)) isQuitting = true; diff --git a/src/imgui/window/animation_preview.cpp b/src/imgui/window/animation_preview.cpp index 79d16cf..a6ba4f7 100644 --- a/src/imgui/window/animation_preview.cpp +++ b/src/imgui/window/animation_preview.cpp @@ -363,8 +363,10 @@ namespace anm2ed::imgui if (!isOnlyShowLayers && root.isVisible && animation->rootAnimation.isVisible) { - auto rootTransform = baseTransform * math::quad_model_get(TARGET_SIZE, root.position, TARGET_SIZE * 0.5f, - math::percent_to_unit(root.scale), root.rotation); + auto rootTransform = + isRootTransform ? baseTransform * math::quad_model_get(TARGET_SIZE, root.position, TARGET_SIZE * 0.5f, + math::percent_to_unit(root.scale), root.rotation) + : baseTransform * math::quad_model_get(TARGET_SIZE, {}, TARGET_SIZE * 0.5f); vec4 color = isOnionskin ? vec4(colorOffset, alphaOffset) : color::GREEN; diff --git a/src/imgui/window/timeline.cpp b/src/imgui/window/timeline.cpp index 47638c7..e7d7605 100644 --- a/src/imgui/window/timeline.cpp +++ b/src/imgui/window/timeline.cpp @@ -1,7 +1,6 @@ #include "timeline.h" #include -#include #include diff --git a/src/state.cpp b/src/state.cpp index a773d19..89bef5a 100644 --- a/src/state.cpp +++ b/src/state.cpp @@ -34,6 +34,7 @@ namespace anm2ed void State::update(SDL_Window*& window, Settings& settings) { SDL_Event event{}; + bool openDroppedDocumentsImmediately = manager.documents.empty(); while (SDL_PollEvent(&event)) { @@ -46,8 +47,10 @@ namespace anm2ed if (filesystem::path_is_extension(droppedFile, "anm2")) { std::filesystem::path droppedPath{droppedFile}; - if (manager.documents.empty()) + if (openDroppedDocumentsImmediately) + { manager.open(droppedPath); + } else { if (std::find(manager.anm2DragDropPaths.begin(), manager.anm2DragDropPaths.end(), droppedPath) ==