From f6d2b1dc31f1dab6e3a63ae9f4d6f497cdcc03a4 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Fri, 26 Jul 2024 03:44:58 +0530 Subject: [PATCH] feat: handleMouseEventForGetText --- src/components/atoms/canvas.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/components/atoms/canvas.tsx b/src/components/atoms/canvas.tsx index 8e07ad21..7642db6b 100644 --- a/src/components/atoms/canvas.tsx +++ b/src/components/atoms/canvas.tsx @@ -38,6 +38,18 @@ const Canvas = ({ width, height, onCreateRef }: CanvasProps) => { const lastMousePosition = useRef({ x: 0, y: 0 }); //const lastWheelPosition = useRef({ deltaX: 0, deltaY: 0 }); + const handleMouseEventForGetText = useCallback((event: MouseEvent) => { + if (socket && getText) { + switch (event.type) { + case 'mousedown': + console.log('Handling text selection logic'); + break; + default: + return; + } + } + }, [socket, getText]); + const onMouseEvent = useCallback((event: MouseEvent) => { if (socket) { const coordinates = {