@remotion/paths 3.3.40 → 3.3.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -47,11 +47,58 @@ const translateSegments = (segments, x, y) => {
47
47
  if (segment.type === 'Z') {
48
48
  return segment;
49
49
  }
50
- return {
51
- ...segment,
52
- x: segment.x + x,
53
- y: segment.y + y,
54
- };
50
+ if (segment.type === 'C') {
51
+ return {
52
+ type: 'C',
53
+ cp1x: segment.cp1x + x,
54
+ cp1y: segment.cp1y + y,
55
+ cp2x: segment.cp2x + x,
56
+ cp2y: segment.cp2y + y,
57
+ x: segment.x + x,
58
+ y: segment.y + y,
59
+ };
60
+ }
61
+ if (segment.type === 'Q') {
62
+ return {
63
+ type: 'Q',
64
+ cpx: segment.cpx + x,
65
+ cpy: segment.cpy + y,
66
+ x: segment.x + x,
67
+ y: segment.y + y,
68
+ };
69
+ }
70
+ if (segment.type === 'S') {
71
+ return {
72
+ type: 'S',
73
+ cpx: segment.cpx + x,
74
+ cpy: segment.cpy + y,
75
+ x: segment.x + x,
76
+ y: segment.y + y,
77
+ };
78
+ }
79
+ if (segment.type === 'T') {
80
+ return {
81
+ type: 'T',
82
+ x: segment.x + x,
83
+ y: segment.y + y,
84
+ };
85
+ }
86
+ if (segment.type === 'L') {
87
+ return {
88
+ type: 'L',
89
+ x: segment.x + x,
90
+ y: segment.y + y,
91
+ };
92
+ }
93
+ if (segment.type === 'M') {
94
+ return {
95
+ type: 'M',
96
+ x: segment.x + x,
97
+ y: segment.y + y,
98
+ };
99
+ }
100
+ // @ts-expect-error
101
+ throw new Error(`Unknown segment type: ${segment.type}`);
55
102
  });
56
103
  };
57
104
  const translatePath = (path, x, y) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/paths",
3
- "version": "3.3.40",
3
+ "version": "3.3.42",
4
4
  "description": "Utility functions for SVG paths",
5
5
  "main": "dist/index.js",
6
6
  "sideEffects": false,
@@ -35,5 +35,5 @@
35
35
  "publishConfig": {
36
36
  "access": "public"
37
37
  },
38
- "gitHead": "be5f606a81761f7f8e1e191ebabd5f8d225d8c09"
38
+ "gitHead": "bfb8098300fb75d4c27220eead954c2dc8e5b4ce"
39
39
  }