mirror of
https://github.com/m1k1o/neko.git
synced 2025-08-01 16:00:51 +02:00
use canvas size when clearing canvas.
This commit is contained in:
parent
b1f53c81c2
commit
a79a5cfd39
2 changed files with 4 additions and 4 deletions
|
@ -213,7 +213,7 @@
|
|||
|
||||
canvasDrawCursor(x: number, y: number, id: string) {
|
||||
// get intrinsic dimensions
|
||||
let { width, height } = this.canvasSize
|
||||
const { width, height } = this.canvasSize
|
||||
x = Math.round((x / this.screenSize.width) * width)
|
||||
y = Math.round((y / this.screenSize.height) * height)
|
||||
|
||||
|
@ -246,7 +246,7 @@
|
|||
// reset transformation, X and Y will be 0 again
|
||||
this._ctx.setTransform(this.canvasScale, 0, 0, this.canvasScale, 0, 0)
|
||||
|
||||
const { width, height } = this._overlay
|
||||
const { width, height } = this.canvasSize
|
||||
this._ctx.clearRect(0, 0, width, height)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -572,7 +572,7 @@
|
|||
if (this.cursorImage.width <= 1 && this.cursorImage.height <= 1) return
|
||||
|
||||
// get intrinsic dimensions
|
||||
let { width, height } = this.canvasSize
|
||||
const { width, height } = this.canvasSize
|
||||
|
||||
// reset transformation, X and Y will be 0 again
|
||||
this._ctx.setTransform(this.canvasScale, 0, 0, this.canvasScale, 0, 0)
|
||||
|
@ -619,7 +619,7 @@
|
|||
// reset transformation, X and Y will be 0 again
|
||||
this._ctx.setTransform(this.canvasScale, 0, 0, this.canvasScale, 0, 0)
|
||||
|
||||
const { width, height } = this._overlay
|
||||
const { width, height } = this.canvasSize
|
||||
this._ctx.clearRect(0, 0, width, height)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue