From 8096521f2811060ac5e6d042f3586280e8bf9e89 Mon Sep 17 00:00:00 2001 From: shweet Date: Sat, 27 Dec 2025 19:33:56 -0500 Subject: [PATCH] timeline width calculation --- src/imgui/window/timeline.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/imgui/window/timeline.cpp b/src/imgui/window/timeline.cpp index 642b975..468d6c7 100644 --- a/src/imgui/window/timeline.cpp +++ b/src/imgui/window/timeline.cpp @@ -1388,9 +1388,11 @@ namespace anm2ed::imgui ImVec2(ImGui::GetContentRegionAvail().x, ImGui::GetContentRegionAvail().y - ImGui::GetTextLineHeightWithSpacing() - style.ItemSpacing.y * 2); - auto childWidth = ImGui::GetContentRegionAvail().x > anm2.animations.length() * ImGui::GetTextLineHeight() - ? ImGui::GetContentRegionAvail().x - : anm2.animations.length() * ImGui::GetTextLineHeight(); + auto childWidth = anm2.animations.length() * ImGui::GetTextLineHeight(); + if (animation && animation->frameNum > anm2.animations.length()) + childWidth = animation->frameNum * ImGui::GetTextLineHeight(); + else if (ImGui::GetContentRegionAvail().x > childWidth) + childWidth = ImGui::GetContentRegionAvail().x; ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2()); if (ImGui::BeginChild("##Frames List Child", viewListChildSize, true, ImGuiWindowFlags_HorizontalScrollbar))