chore(utils): cleanup

This commit is contained in:
moklick
2023-06-12 22:40:33 +02:00
parent d6b8439f6e
commit a04fb2021e
3 changed files with 11 additions and 11 deletions
+2 -2
View File
@@ -9,6 +9,7 @@ import {
isNumeric,
rectToBox,
nodeToRect,
getEventPosition,
} from './utils';
import {
type Connection,
@@ -334,8 +335,7 @@ export function getPointerPosition(
event: MouseEvent | TouchEvent,
{ snapGrid = [0, 0], snapToGrid = false, transform }: GetPointerPositionParams
): XYPosition & { xSnapped: number; ySnapped: number } {
const x = 'touches' in event ? event.touches[0].clientX : event.clientX;
const y = 'touches' in event ? event.touches[0].clientY : event.clientY;
const { x, y } = getEventPosition(event);
const pointerPos = {
x: (x - transform[0]) / transform[2],