|
|
|
@ -3852,14 +3852,20 @@ class App extends React.Component<AppProps, AppState> {
|
|
|
|
|
const dx = pointerCoords.x - draggingElement.x;
|
|
|
|
|
const dy = pointerCoords.y - draggingElement.y;
|
|
|
|
|
|
|
|
|
|
const pressures = draggingElement.simulatePressure
|
|
|
|
|
? draggingElement.pressures
|
|
|
|
|
: [...draggingElement.pressures, event.pressure];
|
|
|
|
|
const lastPoint = points.length > 0 && points[points.length - 1];
|
|
|
|
|
const discardPoint =
|
|
|
|
|
lastPoint && lastPoint[0] === dx && lastPoint[1] === dy;
|
|
|
|
|
|
|
|
|
|
mutateElement(draggingElement, {
|
|
|
|
|
points: [...points, [dx, dy]],
|
|
|
|
|
pressures,
|
|
|
|
|
});
|
|
|
|
|
if (!discardPoint) {
|
|
|
|
|
const pressures = draggingElement.simulatePressure
|
|
|
|
|
? draggingElement.pressures
|
|
|
|
|
: [...draggingElement.pressures, event.pressure];
|
|
|
|
|
|
|
|
|
|
mutateElement(draggingElement, {
|
|
|
|
|
points: [...points, [dx, dy]],
|
|
|
|
|
pressures,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
} else if (isLinearElement(draggingElement)) {
|
|
|
|
|
pointerDownState.drag.hasOccurred = true;
|
|
|
|
|
const points = draggingElement.points;
|
|
|
|
|