[nostalgia/core/studio] Adjust size of SubSheet Editor in cases without size input

This commit is contained in:
2022-03-05 18:29:50 -06:00
parent 94653cb9af
commit e0b2f37925
2 changed files with 10 additions and 3 deletions

View File

@@ -248,10 +248,12 @@ void TileSheetEditorImGui::SubSheetEditor::draw() noexcept {
return;
}
ImGui::OpenPopup(popupName);
ImGui::SetNextWindowSize(ImVec2(235, 125));
const auto modSize = m_cols > 0;
const auto popupHeight = modSize ? 125.f : 80.f;
ImGui::SetNextWindowSize(ImVec2(235, popupHeight));
if (ImGui::BeginPopupModal(popupName, &m_show, modalFlags)) {
ImGui::InputText("Name", m_name.data(), m_name.cap());
if (m_cols != -1) {
if (modSize) {
ImGui::InputInt("Columns", &m_cols);
ImGui::InputInt("Rows", &m_rows);
}