drwhut / tabletop-club

An open-source platform for playing tabletop games in a physics-based 3D environment for Windows, macOS, and Linux! Made with the Godot Engine.
https://tabletopclub.net
MIT License
1.27k stars 55 forks source link

[Bug] Error when raising or lowering the page in Notebook. #83

Closed Unargent closed 2 years ago

Unargent commented 2 years ago

Describe the bug Error when clicking 'move up' or 'move down' in the notebook, above or below the maximum level. Also, the page after that is only deleted after a double deletion.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Notebook'
  2. Create two or more pages
  3. Click on 'Move up' or 'Move down' until the page is at the very bottom or the top
  4. Continue clicking
  5. Try to delete page
  6. See error

Expected behavior 'Move down' button should become unavailable when the minimum page level is reached, but 'Move up' button should work. 'Move up' button should stop working when the maximum page level is reached, but 'Move down' button should work.

Screenshots Screenshot_20220703_181505

Environment Linux/Debian Testing

Version Master

Additional context Error in chat when you click 'Move up' and the page reaches the maximum level: [ERROR] scene/gui/item_list.cpp:304 move_item: Index p_to_idx = -1 is out of bounds (items.size() = 2). [ERROR] scene/gui/item_list.cpp:303 move_item: Index p_from_idx = -1 is out of bounds (items.size() = 2).

Error in chat when deleting a page for the first time: [ERROR] scene/gui/item_list.cpp:80 get_item_text: Index p_idx = -2 is out of bounds (items.size() = 2). [ERROR] scene/gui/item_list.cpp:322 remove_item: Index p_idx = -2 is out of bounds (items.size() = 2). [ERROR] ./core/cowdata.h:164 remove: Index p_index = -2 is out of bounds (size() = 2).