swaroopg92 / penpa-edit

Web application to create and solve Sudokus and Puzzles
https://swaroopg92.github.io/penpa-edit/
Other
110 stars 42 forks source link

Surface mode shortcut doesn't work for colors 11 and 12 #161

Closed RedStorm1024 closed 10 months ago

RedStorm1024 commented 11 months ago

Describe the bug In surface mode, you can switch colors using numbers 0 to 9. This is supposed to work with colors 11 and 12 by pressing 1 and 1 or 1 and 2 in quick succession but it doesn't

To Reproduce

  1. Select Surface Mode
  2. Press 1
  3. Less than 300ms after releasing 1, press 1 or 2
  4. You should now have colors 11 or 12 selected, but you don't

Desktop (please complete the following information):

Additional context I actually found the cause of the bug, which is quite silly. in main.js around line 800, there's an if statement to check if you're in surface mode before setting the variables needed for the shortcut to work. However, opening and closing brackets have been misplaced, so that if statement is inside of an if statement checking if you're in sudoku mode. this makes this bit of code unreachable

(I don't trust myself enough to create a pull request, that's why i did a bug report instead)

swaroopg92 commented 11 months ago

@RedStorm1024 Thanks for reporting. I will fix it in the next update.

swaroopg92 commented 10 months ago

This has been fixed.