reload canvas on image load.

This commit is contained in:
Miroslav Šedivý 2021-02-17 21:54:15 +01:00
parent 525efe17e7
commit 91c465eeca

View File

@ -127,6 +127,7 @@
this.webrtc.addListener('cursor-position', this.onCursorPosition) this.webrtc.addListener('cursor-position', this.onCursorPosition)
this.webrtc.addListener('cursor-image', this.onCursorImage) this.webrtc.addListener('cursor-image', this.onCursorImage)
this.cursorElement.onload = this.canvasRedraw
} }
beforeDestroy() { beforeDestroy() {
@ -134,6 +135,7 @@
this.webrtc.removeListener('cursor-position', this.onCursorPosition) this.webrtc.removeListener('cursor-position', this.onCursorPosition)
this.webrtc.removeListener('cursor-image', this.onCursorImage) this.webrtc.removeListener('cursor-image', this.onCursorImage)
this.cursorElement.onload = null
} }
getMousePos(clientX: number, clientY: number) { getMousePos(clientX: number, clientY: number) {
@ -280,7 +282,6 @@
if (!this.isControling) { if (!this.isControling) {
this.cursorElement.src = data.uri this.cursorElement.src = data.uri
this.canvasRedraw()
} }
} }