Fixing not recreating canvas context if it already exists.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
54f82eab92
commit
2c8011056d
1 changed files with 2 additions and 1 deletions
|
@ -212,8 +212,9 @@ class CanvasAPI extends Module {
|
|||
*/
|
||||
redraw() {
|
||||
if(!this.initialized) throw new Error("Attempting redraw before initialize!")
|
||||
if(this.#ctx == null)
|
||||
this.#ctx = this.#canvas.getContext("2d")
|
||||
this.#redrawCount = (this.#redrawCount + 1) % 10000
|
||||
this.#ctx = this.#canvas.getContext("2d")
|
||||
this._computeAxes()
|
||||
this._reset()
|
||||
this._drawGrid()
|
||||
|
|
Loading…
Add table
Reference in a new issue