From a6e3beb5895aa998d66e5d555ac31e53138a1f11 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sat, 15 Jun 2024 21:09:22 +0530 Subject: [PATCH] chore: lint --- src/components/atoms/canvas.tsx | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/src/components/atoms/canvas.tsx b/src/components/atoms/canvas.tsx index 6a2f9dea..5152cf5e 100644 --- a/src/components/atoms/canvas.tsx +++ b/src/components/atoms/canvas.tsx @@ -1,22 +1,16 @@ -import React, {useCallback, useEffect, useRef} from 'react'; +import React, { useCallback, useEffect, useRef } from 'react'; import { useSocketStore } from '../../context/socket'; import { getMappedCoordinates } from "../../helpers/inputHelpers"; import { useGlobalInfoStore } from "../../context/globalInfo"; interface CreateRefCallback { - (ref: React.RefObject): void; - } interface CanvasProps { - width: number; - height: number; - onCreateRef: CreateRefCallback; - } /** @@ -40,7 +34,7 @@ const Canvas = ({ width, height, onCreateRef }: CanvasProps) => { }; const lastMousePosition = useRef({ x: 0, y: 0 }); - //const lastWheelPosition = useRef({ deltaX: 0, deltaY: 0 }); + //const lastWheelPosition = useRef({ deltaX: 0, deltaY: 0 }); const onMouseEvent = useCallback((event: MouseEvent) => { if (socket) { @@ -57,12 +51,12 @@ const Canvas = ({ width, height, onCreateRef }: CanvasProps) => { case 'mousemove': const coordinates = getMappedCoordinates(event, canvasRef.current, width, height); if (lastMousePosition.current.x !== coordinates.x || - lastMousePosition.current.y !== coordinates.y) { + lastMousePosition.current.y !== coordinates.y) { lastMousePosition.current = { x: coordinates.x, y: coordinates.y, }; - socket.emit('input:mousemove', { + socket.emit('input:mousemove', { x: coordinates.x, y: coordinates.y, }); @@ -122,21 +116,21 @@ const Canvas = ({ width, height, onCreateRef }: CanvasProps) => { } }; - }else { + } else { console.log('Canvas not initialized'); } }, [onMouseEvent]); return ( - // - + // + ); };