From 3a149fad6de8872da4d8489cf944750a47bdca2d Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sat, 24 Jun 2023 00:16:38 -0500 Subject: [PATCH] [nostalgia/core/studio] Fix scaling of controls panel in TileSheetEditorImGui --- .../modules/core/src/studio/tilesheeteditor-imgui.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/nostalgia/modules/core/src/studio/tilesheeteditor-imgui.cpp b/src/nostalgia/modules/core/src/studio/tilesheeteditor-imgui.cpp index 8a7d54d1..f1db8baa 100644 --- a/src/nostalgia/modules/core/src/studio/tilesheeteditor-imgui.cpp +++ b/src/nostalgia/modules/core/src/studio/tilesheeteditor-imgui.cpp @@ -123,6 +123,7 @@ void TileSheetEditorImGui::draw(turbine::Context*) noexcept { ImGui::SameLine(); ImGui::BeginChild("Controls", ImVec2(m_palViewWidth - 8, paneSize.y), true); { + const auto controlsSize = ImGui::GetContentRegionAvail(); ImGui::BeginChild("ToolBox", ImVec2(m_palViewWidth - 24, 30), true); { const auto btnSz = ImVec2(45, 14); @@ -141,14 +142,14 @@ void TileSheetEditorImGui::draw(turbine::Context*) noexcept { } } ImGui::EndChild(); - const auto ySize = paneSize.y - 36; + const auto ySize = controlsSize.y - 38; // draw palette/color picker - ImGui::BeginChild("Palette", ImVec2(m_palViewWidth - 24, ySize / 2.07f), true); + ImGui::BeginChild("Palette", ImVec2(m_palViewWidth - 24, ySize / 2.f), true); { drawPaletteSelector(); } ImGui::EndChild(); - ImGui::BeginChild("SubSheets", ImVec2(m_palViewWidth - 24, ySize / 2.03f), true); + ImGui::BeginChild("SubSheets", ImVec2(m_palViewWidth - 24, ySize / 2.f), true); { static constexpr auto btnHeight = 18; const auto btnSize = ImVec2(18, btnHeight);