Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const rotatePoses = moveablePoses.map(([pos1, pos2, pos3, pos4]) => {
return [
rotate(pos1, -rad),
rotate(pos2, -rad),
rotate(pos3, -rad),
rotate(pos4, -rad),
];
});
groupWidth = getMaxPos(rotatePoses, 0) - getMinPos(rotatePoses, 0);
export function getRotationPosition(
[pos1, pos2]: number[][],
rad: number,
): number[] {
const relativeRotationPos = rotateMatrix([0, -40, 1], rad);
const rotationPos = [
(pos1[0] + pos2[0]) / 2 + relativeRotationPos[0],
(pos1[1] + pos2[1]) / 2 + relativeRotationPos[1],
];
return rotationPos;
}
const rotatePoses = moveablePoses.map(([pos1, pos2, pos3, pos4]) => {
return [
rotate(pos1, -rad),
rotate(pos2, -rad),
rotate(pos3, -rad),
rotate(pos4, -rad),
];
});
groupWidth = getMaxPos(rotatePoses, 0) - getMinPos(rotatePoses, 0);
(child, childDatas, result, i) => {
const [prevX, prevY] = childDatas.prevClient;
const [clientX, clientY] = rotateMatrix([prevX, prevY], rad);
const delta = [clientX - prevX, clientY - prevY];
childDatas.prevClient = [clientX, clientY];
const dragResult = Draggable.drag(
child,
setCustomDrag(child.state, delta, inputEvent),
);
result.drag = dragResult;
},
);
const rotatePoses = moveablePoses.map(([pos1, pos2, pos3, pos4]) => {
return [
rotate(pos1, -rad),
rotate(pos2, -rad),
rotate(pos3, -rad),
rotate(pos4, -rad),
];
});
groupWidth = getMaxPos(rotatePoses, 0) - getMinPos(rotatePoses, 0);
const rotatePoses = moveablePoses.map(([pos1, pos2, pos3, pos4]) => {
return [
rotate(pos1, -rad),
rotate(pos2, -rad),
rotate(pos3, -rad),
rotate(pos4, -rad),
];
});
groupWidth = getMaxPos(rotatePoses, 0) - getMinPos(rotatePoses, 0);