mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
redraw on screenSize and clear if controlling.
This commit is contained in:
parent
6340da049b
commit
8bee5222b1
@ -278,11 +278,25 @@
|
||||
private cursorElement: HTMLImageElement = new Image()
|
||||
private cursorPosition: { x: number; y: number } | null = null
|
||||
|
||||
@Watch('screenSize')
|
||||
onScreenSizeChange() {
|
||||
if (this.isControling) {
|
||||
this.canvasClear()
|
||||
} else {
|
||||
this.canvasRedraw()
|
||||
}
|
||||
}
|
||||
|
||||
@Watch('canvasSize')
|
||||
onCanvasSizeChange({ width, height }: { width: number; height: number }) {
|
||||
this._overlay.width = width
|
||||
this._overlay.height = height
|
||||
this.canvasRedraw()
|
||||
|
||||
if (this.isControling) {
|
||||
this.canvasClear()
|
||||
} else {
|
||||
this.canvasRedraw()
|
||||
}
|
||||
}
|
||||
|
||||
onCursorPosition(data: { x: number; y: number }) {
|
||||
|
Loading…
Reference in New Issue
Block a user