Skip to content

Commit

Permalink
💄 (#379)
Browse files Browse the repository at this point in the history
  • Loading branch information
wcandillon authored Oct 21, 2020
1 parent 2e50842 commit 5abc433
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ export type Path = {
export const serialize = (path: Path) => {
"worklet";
return `M${path.move.x},${path.move.y} ${path.curves
.map((c) => `C${c.c1.x},${c.c1.y} ${c.c2.x},${c.c2.y} ${c.to.x},${c.to.y} `)
.reduce((acc, c) => acc + c)}${path.close ? "Z" : ""}`;
.map((c) => `C${c.c1.x},${c.c1.y} ${c.c2.x},${c.c2.y} ${c.to.x},${c.to.y}`)
.join(" ")}${path.close ? "Z" : ""}`;
};

/**
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/Paths.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const points: Vector[] = [

test("parse()", () => {
const path =
"M150,0 C150,0 0,75 200,75 C75,200 200,225 200,225 C225,200 200,150 0,150 ";
"M150,0 C150,0 0,75 200,75 C75,200 200,225 200,225 C225,200 200,150 0,150";
expect(serialize(parse(path))).toBe(path);
});

Expand Down

0 comments on commit 5abc433

Please sign in to comment.