diff --git a/src/nostalgia/modules/core/src/studio/paletteeditor/paletteeditor-imgui.cpp b/src/nostalgia/modules/core/src/studio/paletteeditor/paletteeditor-imgui.cpp index f39fb950..ebf079a0 100644 --- a/src/nostalgia/modules/core/src/studio/paletteeditor/paletteeditor-imgui.cpp +++ b/src/nostalgia/modules/core/src/studio/paletteeditor/paletteeditor-imgui.cpp @@ -254,15 +254,16 @@ void PaletteEditorImGui::drawColorEditor() noexcept { m_pal, m_page, m_selectedColorRow); } if (!inputFocused) { - for (auto i = 0u; i < ox::min(10, largestPage(m_pal)); ++i) { + auto const lastColor = largestPage(m_pal) - 1; + if (ImGui::IsKeyPressed(ImGuiKey_0, false)) { + m_selectedColorRow = ox::min(9, lastColor); + } else for (auto i = 9u; i < 10; --i) { auto const key = static_cast(ImGuiKey_1 + i); if (ImGui::IsKeyPressed(key, false)) { - m_selectedColorRow = i; + m_selectedColorRow = ox::min(i, lastColor); + break; } } - if (ImGui::IsKeyPressed(ImGuiKey_0, false)) { - m_selectedColorRow = ox::min(9, largestPage(m_pal) - 1); - } } auto const newColor = color16(r, g, b, a); if (c != newColor) {