feat: isCLickCOnfirmed prop
This commit is contained in:
@@ -11,6 +11,7 @@ interface CanvasProps {
|
|||||||
width: number;
|
width: number;
|
||||||
height: number;
|
height: number;
|
||||||
onCreateRef: CreateRefCallback;
|
onCreateRef: CreateRefCallback;
|
||||||
|
isClickConfirmed: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -45,7 +46,8 @@ const Canvas = ({ width, height, onCreateRef }: CanvasProps) => {
|
|||||||
switch (event.type) {
|
switch (event.type) {
|
||||||
case 'mousedown':
|
case 'mousedown':
|
||||||
const clickCoordinates = getMappedCoordinates(event, canvasRef.current, width, height);
|
const clickCoordinates = getMappedCoordinates(event, canvasRef.current, width, height);
|
||||||
socket.emit('input:mousedown', clickCoordinates);
|
//socket.emit('input:mousedown', clickCoordinates);
|
||||||
|
console.log('you clicked on:', clickCoordinates);
|
||||||
notifyLastAction('click');
|
notifyLastAction('click');
|
||||||
break;
|
break;
|
||||||
case 'mousemove':
|
case 'mousemove':
|
||||||
|
|||||||
Reference in New Issue
Block a user