rustwasm / book

The Rust and WebAssembly Book
https://rustwasm.github.io/docs/book/
MIT License
1.75k stars 211 forks source link

Fix pause not showing current state of Universe #208

Open Bcpoole opened 4 years ago

Bcpoole commented 4 years ago

56 # Summary

Explain the motivation for making this change. What existing problem does the pull request solve? 🤔

When the game is paused, the displayed Universe does not match the current state of the Universe. Because of this, the first time when a user clicked a cell (i.e. calls drawCells()) the displayed Universe will update to the current state, causing unexpected interactions. Calling drawCells() in the pause function fixes this.