From 216a65c756694a5339060f2314a32c6c04dff28f Mon Sep 17 00:00:00 2001 From: shweet Date: Tue, 14 Apr 2026 17:17:45 -0400 Subject: [PATCH] baked frames are selected --- src/imgui/window/timeline.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/imgui/window/timeline.cpp b/src/imgui/window/timeline.cpp index 9a3d2c8..d6cc570 100644 --- a/src/imgui/window/timeline.cpp +++ b/src/imgui/window/timeline.cpp @@ -257,8 +257,12 @@ namespace anm2ed::imgui if (auto item = document.item_get()) { std::set bakedSelection{}; - for (auto i : frames.selection | std::views::reverse) + std::vector selectedIndices(frames.selection.begin(), frames.selection.end()); + int insertedBefore = 0; + + for (auto originalIndex : selectedIndices) { + auto i = originalIndex + insertedBefore; if (!vector::in_bounds(item->frames, i)) continue; auto originalDuration = item->frames[i].duration; @@ -269,6 +273,8 @@ namespace anm2ed::imgui : (int)std::ceil((float)originalDuration / settings.bakeInterval); for (int offset = 0; offset < bakedCount; ++offset) bakedSelection.insert(i + offset); + + insertedBefore += bakedCount - 1; } frames.selection = std::move(bakedSelection);