@remotion/shapes 4.0.143 → 4.0.145
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.
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import type { Instruction } from '@remotion/paths';
|
|
2
|
-
export declare const joinPoints: (points: [
|
|
3
|
-
number,
|
|
4
|
-
number
|
|
5
|
-
][], { edgeRoundness, cornerRadius, roundCornerStrategy, }: {
|
|
2
|
+
export declare const joinPoints: (points: [number, number][], { edgeRoundness, cornerRadius, roundCornerStrategy, }: {
|
|
6
3
|
edgeRoundness: number | null;
|
|
7
4
|
cornerRadius: number;
|
|
8
5
|
roundCornerStrategy: 'arc' | 'bezier';
|
|
@@ -35,10 +35,13 @@ const makePolygon = ({ points, radius, cornerRadius = 0, edgeRoundness = null, }
|
|
|
35
35
|
cornerRadius,
|
|
36
36
|
edgeRoundness,
|
|
37
37
|
});
|
|
38
|
+
const reduced = (0, paths_1.reduceInstructions)(polygonPathInstructions);
|
|
39
|
+
const path = (0, paths_1.resetPath)((0, paths_1.serializeInstructions)(reduced));
|
|
40
|
+
const boundingBox = paths_1.PathInternals.getBoundingBoxFromInstructions(reduced);
|
|
38
41
|
return {
|
|
39
|
-
path
|
|
40
|
-
width,
|
|
41
|
-
height,
|
|
42
|
+
path,
|
|
43
|
+
width: boundingBox.width,
|
|
44
|
+
height: boundingBox.height,
|
|
42
45
|
transformOrigin: `${centerX} ${centerY}`,
|
|
43
46
|
instructions: polygonPathInstructions,
|
|
44
47
|
};
|
package/dist/utils/make-star.js
CHANGED
|
@@ -47,10 +47,13 @@ const makeStar = ({ points, innerRadius, outerRadius, cornerRadius = 0, edgeRoun
|
|
|
47
47
|
cornerRadius,
|
|
48
48
|
edgeRoundness,
|
|
49
49
|
});
|
|
50
|
+
const reduced = (0, paths_1.reduceInstructions)(starPathInstructions);
|
|
51
|
+
const path = (0, paths_1.resetPath)((0, paths_1.serializeInstructions)(reduced));
|
|
52
|
+
const boundingBox = paths_1.PathInternals.getBoundingBoxFromInstructions(reduced);
|
|
50
53
|
return {
|
|
51
|
-
path
|
|
52
|
-
width,
|
|
53
|
-
height,
|
|
54
|
+
path,
|
|
55
|
+
width: boundingBox.width,
|
|
56
|
+
height: boundingBox.height,
|
|
54
57
|
transformOrigin: `${centerX} ${centerY}`,
|
|
55
58
|
instructions: starPathInstructions,
|
|
56
59
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/shapes",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.145",
|
|
4
4
|
"description": "Utility functions and components for SVG shapes",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"react-dom": ">=16.8.0"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@remotion/paths": "4.0.
|
|
41
|
+
"@remotion/paths": "4.0.145"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"formatting": "prettier src --check",
|