fix issue with animation length change acting on new reference

This commit is contained in:
shweet committed 2026-08-27 16:09:10 -04:00
1 parent b7c24fad99
commit 9e9dd8bd8a
4 files changed
+12 -5

No files matched your search

+1
View File
@@ -12,6 +12,7 @@ This application was developed with the assistance of a large language model.
- Dockable [Dear ImGui](https://github.com/ocornut/imgui) interface with draggable windows, persistent layout, drag and drop, context menus, and keyboard-focused workflows.
- Timeline editing with multi-selection, cut/copy/paste, duplicate, merge, insert/delete, frame baking, frame dragging, and editable animation length/FPS/loop settings.
- Animation, layer, and null groups for organizing work, including collapsible trees, group roots, visibility toggles, and save-time baking for game compatibility.
- Frame property editing for crop, size, position, pivot, scale, shear, rotation, tint, color offset, regions, shaders, visibility, interpolation, and flips, with single-frame and batch modes.
- Spritesheet tools for adding, replacing, reloading, packing, saving, editing, and generating reusable regions.
- Overlay spritesheets that can be placed on top of base spritesheets for editing and previewing alternate texture work.
- Custom spritesheet shaders with vertex/fragment file paths, reload/compile feedback, enable/disable behavior, and configurable uniform bindings.
+8 -4
View File
@@ -3893,12 +3893,15 @@ namespace anm2ed::imgui
ImGui::SameLine();
auto frameNum = animation ? animation->frameNum : dummy_value<int>();
auto currentAnimationIndex = reference.animationIndex;
ImGui::SetNextItemWidth(widgetSize.x);
if (input_int_range(localize.get(LABEL_ANIMATION_LENGTH), frameNum, FRAME_NUM_MIN, FRAME_NUM_MAX, STEP,
STEP_FAST, !animation ? ImGuiInputTextFlags_DisplayEmptyRefVal : 0) &&
animation)
auto isLengthChanged = input_int_range(localize.get(LABEL_ANIMATION_LENGTH), frameNum, FRAME_NUM_MIN,
FRAME_NUM_MAX, STEP, STEP_FAST,
!animation ? ImGuiInputTextFlags_DisplayEmptyRefVal : 0);
if (ImGui::IsItemActivated()) animationLengthEditIndex = currentAnimationIndex;
if (isLengthChanged && animation)
{
auto animationIndex = reference.animationIndex;
auto animationIndex = animationLengthEditIndex != -1 ? animationLengthEditIndex : currentAnimationIndex;
edit_command_push(EDIT_ANIMATION_LENGTH, Document::ANIMATIONS,
[=](Manager&, Document& document)
{
@@ -3907,6 +3910,7 @@ namespace anm2ed::imgui
animation->frameNum = frameNum;
});
}
if (ImGui::IsItemDeactivated()) animationLengthEditIndex = -1;
ImGui::SetItemTooltip("%s", localize.get(TOOLTIP_ANIMATION_LENGTH));
ImGui::SameLine();
+1
View File
@@ -101,6 +101,7 @@ namespace anm2ed::imgui
Reference frameSelectionSnapshotReference{};
Reference frameSelectionAnchor{};
bool isFrameSelectionAnchorSet{};
int animationLengthEditIndex{-1};
std::vector<TimelineRowReference> rowDragReferences{};
glm::vec2 scroll{};
ImGuiStyle style{};
+2 -1
View File
@@ -16,6 +16,7 @@ Anm2Ed is a modern editor for [i]The Binding of Isaac: Rebirth[/i]'s XML-based &
[*] Dockable [url=https://github.com/ocornut/imgui]Dear ImGui[/url] interface with draggable windows, persistent layout, drag and drop, context menus, and keyboard-focused workflows.
[*] Timeline editing with multi-selection, cut/copy/paste, duplicate, merge, insert/delete, frame baking, frame dragging, and editable animation length/FPS/loop settings.
[*] Animation, layer, and null groups for organizing work, including collapsible trees, group roots, visibility toggles, and save-time baking for game compatibility.
[*] Frame property editing for crop, size, position, pivot, scale, shear, rotation, tint, color offset, regions, shaders, visibility, interpolation, and flips, with single-frame and batch modes.
[*] Spritesheet tools for adding, replacing, reloading, packing, saving, editing, and generating reusable regions.
[*] Overlay spritesheets that can be placed on top of base spritesheets for editing and previewing alternate texture work.
[*] Custom spritesheet shaders with vertex/fragment file paths, reload/compile feedback, enable/disable behavior, and configurable uniform bindings.
@@ -51,6 +52,6 @@ Alternatively, if you have subscribed to the mod, you can find the latest releas
[h3]Happy animating![/h3]
[img]https://files.catbox.moe/4auc1c.gif[/img]
</description>
<version>2.28</version>
<version>2.29</version>
<visibility>Public</visibility>
</metadata>