[nostalgia/core/studio] Fix subsheet editor to allocate correct number of pixels

This commit is contained in:
2022-03-05 15:51:39 -06:00
parent 2f7c62f2ef
commit 20a61de9fd
7 changed files with 33 additions and 19 deletions

View File

@@ -102,7 +102,6 @@ void TileSheetEditorImGui::draw(core::Context*) noexcept {
}
ImGui::EndChild();
m_subsheetEditor.draw();
ImGui::ShowDemoWindow();
}
void TileSheetEditorImGui::drawSubsheetSelector(TileSheet::SubSheet *subsheet, TileSheet::SubSheetIdx *path) noexcept {
@@ -241,10 +240,11 @@ ox::Error TileSheetEditorImGui::markUnsavedChanges(int) noexcept {
void TileSheetEditorImGui::SubSheetEditor::draw() noexcept {
constexpr auto modalFlags = ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize;
constexpr auto popupName = "Edit SubSheet";
if (m_show) {
ImGui::OpenPopup(popupName);
ImGui::SetNextWindowSize(ImVec2(235, 125));
if (!m_show) {
return;
}
ImGui::OpenPopup(popupName);
ImGui::SetNextWindowSize(ImVec2(235, 125));
if (ImGui::BeginPopupModal(popupName, &m_show, modalFlags)) {
ImGui::InputText("Name", m_name.data(), m_name.cap());
if (m_cols != -1) {