diff --git a/src/components/App.tsx b/src/components/App.tsx index e778038e..61cb09e9 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -3852,14 +3852,20 @@ class App extends React.Component { 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;