fix: freehand points (#4031)

Co-authored-by: dwelle <luzar.david@gmail.com>
This commit is contained in:
Steve Ruiz 2021-10-11 19:11:26 +01:00 committed by GitHub
parent 982cba2035
commit 00c6940851
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 49 additions and 24 deletions

View file

@ -804,7 +804,7 @@ export function getFreeDrawSvgPath(element: ExcalidrawFreeDrawElement) {
smoothing: 0.5,
streamline: 0.5,
easing: (t) => Math.sin((t * Math.PI) / 2), // https://easings.net/#easeOutSine
last: false,
last: !!element.lastCommittedPoint, // LastCommittedPoint is added on pointerup
};
return getSvgPathFromStroke(getStroke(inputPoints as number[][], options));
@ -839,5 +839,5 @@ function getSvgPathFromStroke(points: number[][]): string {
["M", points[0], "Q"],
)
.join(" ")
.replaceAll(TO_FIXED_PRECISION, "$1");
.replace(TO_FIXED_PRECISION, "$1");
}