Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug Fix : Updating colors makes the game state disappear (#19)
* Bug Fix : Updating colors makes the game state disappear ## The Issue The colors changing option for lines, points and background caused the entire game state to disappear after the changing the color ## How to replicate the bug 1. Launch the activity 2. Marks a few lines and own a few square 3. Change any one of the colors 4. Notice that the entire board has disappeared ## Demonstration <img src="https://thumbs2.imgbox.com/fd/ee/mzsPQ7S6_t.gif" alt="image host"/> The colors changing option for lines, points and background caused the entire game state to disappear after the changing the color This was due to the board being cleared and the newer lines having the new colors but the older lines not being redrawn I have added a function called `draw_board` on the `Game` class which re-renders all the lines and also the owners of each boxes (if they are owned) calling the function every time any color is changed ensures that the state is visible even after changing the colors * floor division instead of plain regular in draw_board * Fix missing preview request * bug fix: new game did not reset board only made iboard disappear * refactored set_board_size and reset_game to make them more modular by implementing clear_game function
- Loading branch information