From d88252c6fde40ce5bd7b4a0e2929b63200bc944c Mon Sep 17 00:00:00 2001 From: paxcut <53811119+paxcut@users.noreply.github.com> Date: Sun, 15 Sep 2024 06:27:39 -0700 Subject: [PATCH] fix: Unable to resize 3d-visualizer window in x-direction (#1860) changes needed were: 1) add an extra dummy empty widget so that width of child and parent are not always the same. 2) Width of reset button needs to be adjusted when the width of the child is decreased so that the parent is decreased too. ### Problem description ### Implementation description ### Screenshots ### Additional things --- .../source/content/pl_visualizers/3d_model.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/visualizers/source/content/pl_visualizers/3d_model.cpp b/plugins/visualizers/source/content/pl_visualizers/3d_model.cpp index a0aca6de8..c48cc9c89 100644 --- a/plugins/visualizers/source/content/pl_visualizers/3d_model.cpp +++ b/plugins/visualizers/source/content/pl_visualizers/3d_model.cpp @@ -507,6 +507,14 @@ namespace hex::plugin::visualizers { } ImGui::EndChild(); ImGui::PopStyleVar(); + { + ImGui::SameLine(); + { + ImGui::PushID(5); + ImGui::Dummy(ImVec2(0, 0)); + ImGui::PopID(); + } + } // Draw axis arrows toggle { @@ -586,7 +594,7 @@ namespace hex::plugin::visualizers { ImGui::SeparatorEx(ImGuiSeparatorFlags_Vertical); ImGui::SameLine(); - if (ImGuiExt::DimmedButton("hex.ui.common.reset"_lang, ImVec2(ImGui::GetContentRegionAvail().x, 0))) { + if (ImGuiExt::DimmedButton("hex.ui.common.reset"_lang, ImVec2(renderingWindowSize.x-ImGui::GetCursorPosX(), 0))) { s_translation = { { 0.0F, 0.0F, -3.0F } }; s_rotation = { { 0.0F, 0.0F, 0.0F } }; s_scaling = 1.0F;