Skip to content

🎥 Make videos programmatically with React

work on props

Jonny Burger9842526838d5
diff --git a/packages/docs/components/demos/types.ts b/packages/docs/components/demos/types.ts
index b861d6fa76..e3e0c45821 100644
--- a/packages/docs/components/demos/types.ts
+++ b/packages/docs/components/demos/types.ts
@@ -243,7 +243,7 @@ export const starDemo: DemoType = {
{
name: "cornerRadius",
default: 0,
- max: 100,
+ max: 200,
min: 0,
step: 1,
type: "numeric",
diff --git a/packages/docs/docs/shapes/star.md b/packages/docs/docs/shapes/star.md
index d69c3bb451..251c2a2cbf 100644
--- a/packages/docs/docs/shapes/star.md
+++ b/packages/docs/docs/shapes/star.md
@@ -28,14 +28,7 @@ export const MyComposition = () => {
alignItems: "center",
}}
>
- <Star
- height={200}
- width={200}
- points={5}
- innerRadius={150}
- outerRadius={200}
- fill="red"
- />
+ <Star points={5} innerRadius={150} outerRadius={200} fill="red" />
</AbsoluteFill>
);
};
diff --git a/packages/shapes/src/utils/make-star.ts b/packages/shapes/src/utils/make-star.ts
index ad495ec07c..0abb5961a1 100644
--- a/packages/shapes/src/utils/make-star.ts
+++ b/packages/shapes/src/utils/make-star.ts
@@ -9,8 +9,8 @@ export type MakeStarProps = {
points: number;
innerRadius: number;
outerRadius: number;
- edgeRoundness: number | null;
- cornerRadius: number;
+ edgeRoundness?: number | null;
+ cornerRadius?: number;
};
export type StarProps = {
@@ -47,7 +47,7 @@ const star = ({
return joinPoints([...d, d[0]], {
edgeRoundness,
cornerRadius,
- roundCornerStrategy: 'arc',
+ roundCornerStrategy: cornerRadius > 0 ? 'bezier' : 'arc',
});
};
@@ -55,8 +55,8 @@ export const makeStar = ({
points,
innerRadius,
outerRadius,
- cornerRadius,
- edgeRoundness,
+ cornerRadius = 0,
+ edgeRoundness = null,
}: MakeStarProps): ShapeInfo => {
const width = outerRadius * 2;
const height = outerRadius * 2;