mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
use canvas size when clearing canvas.
This commit is contained in:
parent
b1f53c81c2
commit
a79a5cfd39
@ -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…
Reference in New Issue
Block a user