From 606c9337bb2a73933a3af2378fe2436cfb74037e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= Date: Mon, 1 Nov 2021 21:15:57 +0100 Subject: [PATCH] set inactive cursor draw function. --- src/component/cursors.vue | 4 ++-- src/component/main.vue | 8 +++++++- src/component/overlay.vue | 2 +- src/component/types/cursors.ts | 11 ++++++++++- src/component/types/overlay.ts | 13 ------------- 5 files changed, 20 insertions(+), 18 deletions(-) delete mode 100644 src/component/types/overlay.ts diff --git a/src/component/cursors.vue b/src/component/cursors.vue index 332f00e4..314af02e 100644 --- a/src/component/cursors.vue +++ b/src/component/cursors.vue @@ -17,7 +17,7 @@ import { Vue, Component, Ref, Prop, Watch } from 'vue-property-decorator' import { Cursor, Session } from './types/state' - import { CursorDrawFunction, Dimension } from './types/cursors' + import { InactiveCursorDrawFunction, Dimension } from './types/cursors' const CANVAS_SCALE = 2 @@ -44,7 +44,7 @@ private readonly cursors!: Cursor[] @Prop() - private readonly cursorDraw!: CursorDrawFunction | null + private readonly cursorDraw!: InactiveCursorDrawFunction | null mounted() { // get canvas overlay context diff --git a/src/component/main.vue b/src/component/main.vue index 6856845f..6cc14072 100644 --- a/src/component/main.vue +++ b/src/component/main.vue @@ -10,6 +10,7 @@ :screenSize="state.screen.size" :canvasSize="canvasSize" :cursors="state.cursors.list" + :cursorDraw="inactiveCursorDrawFunction" /> void +import { CursorImage } from './webrtc' + +export type CursorDrawFunction = (ctx: CanvasRenderingContext2D, x: number, y: number, cursorElement: HTMLImageElement, cursorImage: CursorImage, cursorTag: string) => void + +export type InactiveCursorDrawFunction = (ctx: CanvasRenderingContext2D, x: number, y: number, cursorTag: string) => void export interface Dimension { width: number height: number } + +export interface KeyboardModifiers { + capslock: boolean + numlock: boolean +} diff --git a/src/component/types/overlay.ts b/src/component/types/overlay.ts deleted file mode 100644 index 57c1d414..00000000 --- a/src/component/types/overlay.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { CursorImage } from './webrtc' - -export type CursorDrawFunction = (ctx: CanvasRenderingContext2D, x: number, y: number, cursorElement: HTMLImageElement, cursorImage: CursorImage, cursorTag: string) => void - -export interface Dimension { - width: number - height: number -} - -export interface KeyboardModifiers { - capslock: boolean - numlock: boolean -}