feat: use getMappedCoordinates for coordinates
This commit is contained in:
@@ -50,11 +50,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', {
|
socket.emit('input:mousedown', clickCoordinates);
|
||||||
x: event.clientX,
|
|
||||||
y: event.clientY,
|
|
||||||
});
|
|
||||||
notifyLastAction('click');
|
notifyLastAction('click');
|
||||||
break;
|
break;
|
||||||
case 'mousemove':
|
case 'mousemove':
|
||||||
|
|||||||
Reference in New Issue
Block a user