From cd8d0da96a26c5110e8acc0e47862a70e4b552fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= Date: Tue, 26 Oct 2021 22:55:22 +0200 Subject: [PATCH] inactive cursors ignore own cursor. --- src/component/cursors.vue | 6 ++++++ src/component/main.vue | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/component/cursors.vue b/src/component/cursors.vue index 97ccf4ff..d711840e 100644 --- a/src/component/cursors.vue +++ b/src/component/cursors.vue @@ -28,6 +28,9 @@ @Ref('overlay') readonly _overlay!: HTMLCanvasElement private _ctx!: CanvasRenderingContext2D + @Prop() + private readonly sessionId!: string + @Prop() private readonly screenSize!: Dimension @@ -90,6 +93,9 @@ // draw cursors for (let { id, x, y } of this.cursors) { + // ignore own cursor + if (id == this.sessionId) continue + // get cursor position x = Math.round((x / this.screenSize.width) * width) y = Math.round((y / this.screenSize.height) * height) diff --git a/src/component/main.vue b/src/component/main.vue index 43305101..8a0c4ba6 100644 --- a/src/component/main.vue +++ b/src/component/main.vue @@ -3,7 +3,12 @@