Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
origin,
offsetMatrix,
targetMatrix,
transformOrigin,
} = moveable.state;
const n = is3d ? 4 : 3;
datas.is3d = is3d;
datas.matrix = matrix;
datas.targetMatrix = targetMatrix;
datas.beforeMatrix = beforeMatrix;
datas.offsetMatrix = offsetMatrix;
datas.transformOrigin = transformOrigin;
datas.inverseMatrix = invert(matrix, n);
datas.inverseBeforeMatrix = invert(beforeMatrix, n);
datas.absoluteOrigin = convertPositionMatrix(plus([left, top], origin), n);
datas.startDragBeforeDist = caculate(datas.inverseBeforeMatrix, datas.absoluteOrigin, n);
datas.startDragDist = caculate(datas.inverseMatrix, datas.absoluteOrigin, n);
}
export function getDragDist({ datas, distX, distY }: any, isBefore?: boolean) {
export function caculatePosition(matrix: number[], pos: number[], n: number) {
return caculate(matrix, convertPositionMatrix(pos, n), n);
}
export function caculatePoses(matrix: number[], width: number, height: number, n: number) {