From c0bac696dc64d8db3c069593504e81da2dca533e Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sat, 19 Apr 2025 14:41:20 -0500 Subject: [PATCH] [nostalgia/gfx/studio/paletteeditor] Fix color number key range --- release-notes.md | 2 ++ .../gfx/src/studio/paletteeditor/paletteeditor-imgui.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/release-notes.md b/release-notes.md index 9ad01653..8291210c 100644 --- a/release-notes.md +++ b/release-notes.md @@ -3,6 +3,8 @@ * Add app icon for both window and file * Fix selection clearing in TileSheet editor to work when clicking outside image. +* Fix color number key range in PalettEditor. Previously, pressing A caused the + editor to jump to the last color. # d2025.02.1 diff --git a/src/nostalgia/modules/gfx/src/studio/paletteeditor/paletteeditor-imgui.cpp b/src/nostalgia/modules/gfx/src/studio/paletteeditor/paletteeditor-imgui.cpp index 2f01775a..06cca318 100644 --- a/src/nostalgia/modules/gfx/src/studio/paletteeditor/paletteeditor-imgui.cpp +++ b/src/nostalgia/modules/gfx/src/studio/paletteeditor/paletteeditor-imgui.cpp @@ -131,7 +131,7 @@ void PaletteEditorImGui::numShortcuts(size_t &val, size_t const sizeRange) noexc auto const lastElem = sizeRange - 1; if (ImGui::IsKeyPressed(ImGuiKey_0)) { val = ox::min(9, lastElem); - } else for (auto i = 9u; i < 10; --i) { + } else for (auto i = 8u; i < 9; --i) { auto const key = static_cast(ImGuiKey_1 + i); if (ImGui::IsKeyPressed(key)) { val = ox::min(i, lastElem);