diff --git a/src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheeteditor-imgui.cpp b/src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheeteditor-imgui.cpp index 82745217..fc7f2d40 100644 --- a/src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheeteditor-imgui.cpp +++ b/src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheeteditor-imgui.cpp @@ -158,21 +158,25 @@ void TileSheetEditorImGui::keyStateChanged(turbine::Key key, bool down) { } else if (key >= turbine::Key::Num_1 && key <= turbine::Key::Num_9) { if (turbine::buttonDown(m_tctx, turbine::Key::Mod_Alt)) { auto const idx = ox::min( - static_cast(key - turbine::Key::Num_1), m_model.pal().pages.size() - 1); + static_cast(key - turbine::Key::Num_1), + m_model.pal().pages.size() - 1); m_model.setPalettePage(idx); - } else if (key <= turbine::Key::Num_0 + colorCnt) { + } else if (key <= turbine::Key::Num_9) { auto const idx = ox::min( - static_cast(key - turbine::Key::Num_1), colorCnt - 1); + static_cast(key - turbine::Key::Num_1), + colorCnt - 1); m_view.setPalIdx(idx); } } else if (key == turbine::Key::Num_0) { if (turbine::buttonDown(m_tctx, turbine::Key::Mod_Alt)) { auto const idx = ox::min( - static_cast(key - turbine::Key::Num_1 + 9), m_model.pal().pages.size() - 1); + static_cast(key - turbine::Key::Num_1 + 9), + m_model.pal().pages.size() - 1); m_model.setPalettePage(idx); - } else if (colorCnt >= 10) { + } else { auto const idx = ox::min( - static_cast(key - turbine::Key::Num_1 + 9), colorCnt - 1); + static_cast(key - turbine::Key::Num_1 + 9), + colorCnt - 1); m_view.setPalIdx(idx); } }