kitao / pyxel

A retro game engine for Python
MIT License
15.31k stars 847 forks source link

pyxel edit で音符マークを押したら music_editor.py の インデックスエラーで異常終了する。 #523

Closed irinaka-robodone closed 8 months ago

irinaka-robodone commented 9 months ago

Windows 10 の Python 3.11 で

pyxel edit

と実行して音符マークを押したところ、タイトルの通り pyxel のエラーで異常終了しました。

https://github.com/kitao/pyxel/assets/103298098/d27aa0a0-4487-4c6c-ae12-146258c6dcd1

Traceback (most recent call last):
  File "C:\Users\user\...\typing-game-2023\.venv\lib\site-packages\pyxel\editor\widgets\widget.py", line 207, in draw_all
    child.draw_all()
  File "C:\Users\user\...\typing-game-2023\.venv\lib\site-packages\pyxel\editor\widgets\widget.py", line 207, in draw_all
    child.draw_all()
  File "C:\Users\user\...\typing-game-2023\.venv\lib\site-packages\pyxel\editor\widgets\widget.py", line 205, in draw_all
    self.trigger_event("draw")
  File "C:\Users\user\...\typing-game-2023\.venv\lib\site-packages\pyxel\editor\widgets\widget.py", line 112, in trigger_event       
    listener(*args)
  File "C:\Users\user\...\typing-game-2023\.venv\lib\site-packages\pyxel\editor\music_field.py", line 81, in __on_draw
    cursor_x = self.field_cursor.x
  File "C:\Users\user\...\typing-game-2023\.venv\lib\site-packages\pyxel\editor\field_cursor.py", line 37, in x
    else self._adjusted_cursor_x
  File "C:\Users\user\...\typing-game-2023\.venv\lib\site-packages\pyxel\editor\field_cursor.py", line 77, in _adjusted_cursor_x     
    return min(self._cursor_x, self._max_cursor_x)
  File "C:\Users\user\...\typing-game-2023\.venv\lib\site-packages\pyxel\editor\field_cursor.py", line 62, in _max_cursor_x
    return max(min(len(self.field), self._max_field_length - 1), 0)
  File "C:\Users\user\...\typing-game-2023\.venv\lib\site-packages\pyxel\editor\field_cursor.py", line 54, in field
    return self._get_field(self._cursor_y)
  File "C:\Users\user\...\typing-game-2023\.venv\lib\site-packages\pyxel\editor\music_editor.py", line 96, in get_field
    return music.seqs[index]
IndexError: list index out of range
fgallaire commented 8 months ago

Use the last version, this bug is fixed since Pyxel 2.0.5