feat:add angle constrained freedraw

This commit is contained in:
AMRITESH240304 2024-10-04 17:16:58 +05:30
parent 47ee8a0094
commit 755135302c

View file

@ -7993,8 +7993,17 @@ class App extends React.Component<AppProps, AppState> {
if (newElement.type === "freedraw") {
const points = newElement.points;
const dx = pointerCoords.x - newElement.x;
const dy = pointerCoords.y - newElement.y;
let dx = pointerCoords.x - newElement.x;
let dy = pointerCoords.y - newElement.y;
if (shouldRotateWithDiscreteAngle(event)) {
({ width: dx, height: dy } = getLockedLinearCursorAlignSize(
newElement.x,
newElement.y,
pointerCoords.x,
pointerCoords.y,
));
}
const lastPoint = points.length > 0 && points[points.length - 1];
const discardPoint =