Skip to content

🎥 Make videos programmatically with React

angle

Jonny Burger259e50b09c52
diff --git a/packages/docs/components/demos/types.ts b/packages/docs/components/demos/types.ts
index 8c35c21882..b861d6fa76 100644
--- a/packages/docs/components/demos/types.ts
+++ b/packages/docs/components/demos/types.ts
@@ -205,7 +205,7 @@ export const starDemo: DemoType = {
autoPlay: true,
options: [
{
- default: 150,
+ default: 100,
max: 400,
step: 5,
min: 1,
diff --git a/packages/shapes/src/utils/make-star.ts b/packages/shapes/src/utils/make-star.ts
index d2e1998dd9..ad495ec07c 100644
--- a/packages/shapes/src/utils/make-star.ts
+++ b/packages/shapes/src/utils/make-star.ts
@@ -32,20 +32,17 @@ const star = ({
cornerRadius,
edgeRoundness,
}: StarProps): Instruction[] => {
- const degreeIncrement = 360 / (points * 2);
- const d = new Array(points * 2)
- .fill('true')
- .map((_p, i): [number, number] => {
- const radius = i % 2 === 0 ? outerRadius : innerRadius;
- const degrees = degreeIncrement * i;
- const angleInRadians = ((degrees - 90) * Math.PI) / 180.0;
- const point = {
- x: centerX + radius * Math.cos(angleInRadians),
- y: centerY + radius * Math.sin(angleInRadians),
- };
+ const degreeIncrement = (Math.PI * 2) / (points * 2);
+ const d = new Array(points * 2).fill(true).map((_p, i): [number, number] => {
+ const radius = i % 2 === 0 ? outerRadius : innerRadius;
+ const angle = degreeIncrement * i - Math.PI / 2;
+ const point = {
+ x: centerX + radius * Math.cos(angle),
+ y: centerY + radius * Math.sin(angle),
+ };
- return [point.x, point.y];
- });
+ return [point.x, point.y];
+ });
return joinPoints([...d, d[0]], {
edgeRoundness,