[nostalgia/gfx/studio/paletteeditor] Fix color number key range
All checks were successful
Build / build (push) Successful in 1m16s

This commit is contained in:
Gary Talent 2025-04-19 14:41:20 -05:00
parent 95f7c33419
commit c0bac696dc
2 changed files with 3 additions and 1 deletions

View File

@ -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

View File

@ -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<size_t>(9, lastElem);
} else for (auto i = 9u; i < 10; --i) {
} else for (auto i = 8u; i < 9; --i) {
auto const key = static_cast<ImGuiKey>(ImGuiKey_1 + i);
if (ImGui::IsKeyPressed(key)) {
val = ox::min<size_t>(i, lastElem);