canvas cursor draw, reset x & y before clear #9.

This commit is contained in:
Miroslav Šedivý 2022-08-30 23:02:44 +02:00
parent a6abe0aac6
commit abb28b1d10
2 changed files with 6 additions and 0 deletions

View File

@ -233,6 +233,9 @@
} }
canvasClear() { canvasClear() {
// reset transformation, X and Y will be 0 again
this._ctx.setTransform(CANVAS_SCALE, 0, 0, CANVAS_SCALE, 0, 0)
const { width, height } = this._overlay const { width, height } = this._overlay
this._ctx.clearRect(0, 0, width, height) this._ctx.clearRect(0, 0, width, height)
} }

View File

@ -559,6 +559,9 @@
} }
canvasClear() { canvasClear() {
// reset transformation, X and Y will be 0 again
this._ctx.setTransform(CANVAS_SCALE, 0, 0, CANVAS_SCALE, 0, 0)
const { width, height } = this._overlay const { width, height } = this._overlay
this._ctx.clearRect(0, 0, width, height) this._ctx.clearRect(0, 0, width, height)
} }