[nostalgia/core/studio] Fix scaling of controls panel in TileSheetEditorImGui

This commit is contained in:
Gary Talent 2023-06-24 00:16:38 -05:00
parent de50a5392a
commit 3a149fad6d

View File

@ -123,6 +123,7 @@ void TileSheetEditorImGui::draw(turbine::Context*) noexcept {
ImGui::SameLine(); ImGui::SameLine();
ImGui::BeginChild("Controls", ImVec2(m_palViewWidth - 8, paneSize.y), true); ImGui::BeginChild("Controls", ImVec2(m_palViewWidth - 8, paneSize.y), true);
{ {
const auto controlsSize = ImGui::GetContentRegionAvail();
ImGui::BeginChild("ToolBox", ImVec2(m_palViewWidth - 24, 30), true); ImGui::BeginChild("ToolBox", ImVec2(m_palViewWidth - 24, 30), true);
{ {
const auto btnSz = ImVec2(45, 14); const auto btnSz = ImVec2(45, 14);
@ -141,14 +142,14 @@ void TileSheetEditorImGui::draw(turbine::Context*) noexcept {
} }
} }
ImGui::EndChild(); ImGui::EndChild();
const auto ySize = paneSize.y - 36; const auto ySize = controlsSize.y - 38;
// draw palette/color picker // 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(); drawPaletteSelector();
} }
ImGui::EndChild(); 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; static constexpr auto btnHeight = 18;
const auto btnSize = ImVec2(18, btnHeight); const auto btnSize = ImVec2(18, btnHeight);