fix: freedraw slow movement jittery lines (#4726)
Co-authored-by: David Luzar <luzar.david@gmail.com>
This commit is contained in:
parent
98ea46664c
commit
96de887cc8
@ -3852,6 +3852,11 @@ class App extends React.Component<AppProps, AppState> {
|
||||
const dx = pointerCoords.x - draggingElement.x;
|
||||
const dy = pointerCoords.y - draggingElement.y;
|
||||
|
||||
const lastPoint = points.length > 0 && points[points.length - 1];
|
||||
const discardPoint =
|
||||
lastPoint && lastPoint[0] === dx && lastPoint[1] === dy;
|
||||
|
||||
if (!discardPoint) {
|
||||
const pressures = draggingElement.simulatePressure
|
||||
? draggingElement.pressures
|
||||
: [...draggingElement.pressures, event.pressure];
|
||||
@ -3860,6 +3865,7 @@ class App extends React.Component<AppProps, AppState> {
|
||||
points: [...points, [dx, dy]],
|
||||
pressures,
|
||||
});
|
||||
}
|
||||
} else if (isLinearElement(draggingElement)) {
|
||||
pointerDownState.drag.hasOccurred = true;
|
||||
const points = draggingElement.points;
|
||||
|
Loading…
x
Reference in New Issue
Block a user