quck fixes to issues i noticed while doing a general overview
This commit is contained in:
@@ -175,7 +175,6 @@ namespace anm2ed::imgui
|
|||||||
{
|
{
|
||||||
if (!manager.anm2DragDropPopup.is_open()) manager.anm2DragDropPopup.open();
|
if (!manager.anm2DragDropPopup.is_open()) manager.anm2DragDropPopup.open();
|
||||||
|
|
||||||
bool wasOpen = manager.anm2DragDropPopup.is_open();
|
|
||||||
manager.anm2DragDropPopup.trigger();
|
manager.anm2DragDropPopup.trigger();
|
||||||
|
|
||||||
if (ImGui::BeginPopupContextWindow(manager.anm2DragDropPopup.label, ImGuiPopupFlags_None))
|
if (ImGui::BeginPopupContextWindow(manager.anm2DragDropPopup.label, ImGuiPopupFlags_None))
|
||||||
@@ -212,7 +211,7 @@ namespace anm2ed::imgui
|
|||||||
manager.anm2DragDropPopup.end();
|
manager.anm2DragDropPopup.end();
|
||||||
ImGui::EndPopup();
|
ImGui::EndPopup();
|
||||||
}
|
}
|
||||||
else if (wasOpen && !manager.anm2DragDropPopup.is_open())
|
else if (!ImGui::IsPopupOpen(manager.anm2DragDropPopup.label))
|
||||||
drag_drop_reset();
|
drag_drop_reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -909,7 +909,9 @@ namespace anm2ed::imgui
|
|||||||
if (shortcut(manager.chords[SHORTCUT_OPEN], shortcut::GLOBAL)) dialog.file_open(dialog::ANM2_OPEN);
|
if (shortcut(manager.chords[SHORTCUT_OPEN], shortcut::GLOBAL)) dialog.file_open(dialog::ANM2_OPEN);
|
||||||
if (shortcut(manager.chords[SHORTCUT_SAVE], shortcut::GLOBAL))
|
if (shortcut(manager.chords[SHORTCUT_SAVE], shortcut::GLOBAL))
|
||||||
{
|
{
|
||||||
if (settings.fileIsWarnOverwrite) overwritePopup.open();
|
if (settings.fileIsWarnOverwrite)
|
||||||
|
overwritePopup.open();
|
||||||
|
else
|
||||||
manager.save();
|
manager.save();
|
||||||
}
|
}
|
||||||
if (shortcut(manager.chords[SHORTCUT_SAVE_AS], shortcut::GLOBAL)) dialog.file_save(dialog::ANM2_SAVE);
|
if (shortcut(manager.chords[SHORTCUT_SAVE_AS], shortcut::GLOBAL)) dialog.file_save(dialog::ANM2_SAVE);
|
||||||
|
|||||||
@@ -363,8 +363,10 @@ namespace anm2ed::imgui
|
|||||||
|
|
||||||
if (!isOnlyShowLayers && root.isVisible && animation->rootAnimation.isVisible)
|
if (!isOnlyShowLayers && root.isVisible && animation->rootAnimation.isVisible)
|
||||||
{
|
{
|
||||||
auto rootTransform = baseTransform * math::quad_model_get(TARGET_SIZE, root.position, TARGET_SIZE * 0.5f,
|
auto rootTransform =
|
||||||
math::percent_to_unit(root.scale), root.rotation);
|
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;
|
vec4 color = isOnionskin ? vec4(colorOffset, alphaOffset) : color::GREEN;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
#include "timeline.h"
|
#include "timeline.h"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cstddef>
|
|
||||||
|
|
||||||
#include <imgui_internal.h>
|
#include <imgui_internal.h>
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ namespace anm2ed
|
|||||||
void State::update(SDL_Window*& window, Settings& settings)
|
void State::update(SDL_Window*& window, Settings& settings)
|
||||||
{
|
{
|
||||||
SDL_Event event{};
|
SDL_Event event{};
|
||||||
|
bool openDroppedDocumentsImmediately = manager.documents.empty();
|
||||||
|
|
||||||
while (SDL_PollEvent(&event))
|
while (SDL_PollEvent(&event))
|
||||||
{
|
{
|
||||||
@@ -46,8 +47,10 @@ namespace anm2ed
|
|||||||
if (filesystem::path_is_extension(droppedFile, "anm2"))
|
if (filesystem::path_is_extension(droppedFile, "anm2"))
|
||||||
{
|
{
|
||||||
std::filesystem::path droppedPath{droppedFile};
|
std::filesystem::path droppedPath{droppedFile};
|
||||||
if (manager.documents.empty())
|
if (openDroppedDocumentsImmediately)
|
||||||
|
{
|
||||||
manager.open(droppedPath);
|
manager.open(droppedPath);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (std::find(manager.anm2DragDropPaths.begin(), manager.anm2DragDropPaths.end(), droppedPath) ==
|
if (std::find(manager.anm2DragDropPaths.begin(), manager.anm2DragDropPaths.end(), droppedPath) ==
|
||||||
|
|||||||
Reference in New Issue
Block a user