handling saving issues in certain contexts/new shortcuts

This commit is contained in:
2026-01-05 04:16:51 -05:00
parent a8143b6d0c
commit b41b6df19e
7 changed files with 87 additions and 22 deletions

View File

@@ -1866,21 +1866,21 @@ namespace anm2ed::imgui
}
isExtendChordHeld = isExtendFrame;
if (shortcut(manager.chords[SHORTCUT_PREVIOUS_FRAME], shortcut::GLOBAL))
{
if (auto item = document.item_get(); !item->frames.empty())
{
reference.frameIndex = glm::clamp(--reference.frameIndex, 0, (int)item->frames.size() - 1);
frames_selection_set_reference();
document.frameTime = item->frame_time_from_index_get(reference.frameIndex);
}
}
auto isPreviousFrame = shortcut(manager.chords[SHORTCUT_PREVIOUS_FRAME], shortcut::GLOBAL);
auto isNextFrame = shortcut(manager.chords[SHORTCUT_NEXT_FRAME], shortcut::GLOBAL);
if (shortcut(manager.chords[SHORTCUT_NEXT_FRAME], shortcut::GLOBAL))
if (isPreviousFrame)
if (auto item = document.item_get(); !item->frames.empty())
reference.frameIndex = glm::clamp(--reference.frameIndex, 0, (int)item->frames.size() - 1);
if (isNextFrame)
if (auto item = document.item_get(); !item->frames.empty())
reference.frameIndex = glm::clamp(++reference.frameIndex, 0, (int)item->frames.size() - 1);
if (isPreviousFrame || isNextFrame)
{
if (auto item = document.item_get(); !item->frames.empty())
{
reference.frameIndex = glm::clamp(++reference.frameIndex, 0, (int)item->frames.size() - 1);
frames_selection_set_reference();
document.frameTime = item->frame_time_from_index_get(reference.frameIndex);
}