Skip to content

🎥 Make videos programmatically with React

@remotion/shapes: Fix edgeRoundness missing from Arrow docs, add cornerRadius/edgeRoundness tests

copilot-swe-agent[bot]500ed9497fee
diff --git a/packages/docs/components/shapes/shapes-info.tsx b/packages/docs/components/shapes/shapes-info.tsx
index 6ce2e29978..c3ad324c29 100644
--- a/packages/docs/components/shapes/shapes-info.tsx
+++ b/packages/docs/components/shapes/shapes-info.tsx
@@ -58,6 +58,12 @@ export const shapeComponents: ShapeComponent[] = [
type: '"left" | "right" | "up" | "down"',
description: 'The direction the arrow points. Default right.',
},
+ {
+ name: 'edgeRoundness',
+ type: 'number | null',
+ description:
+ 'Allows to modify the shape by rounding the edges using bezier curves. Default null.',
+ },
],
},
{
diff --git a/packages/shapes/src/test/make-arrow.test.ts b/packages/shapes/src/test/make-arrow.test.ts
index b98ae877e1..def2e71ba3 100644
--- a/packages/shapes/src/test/make-arrow.test.ts
+++ b/packages/shapes/src/test/make-arrow.test.ts
@@ -100,3 +100,35 @@ test('Should throw if headLength > length', () => {
}),
).toThrow('"headLength" must be less than or equal to "length"');
});
+
+test('Should be able to make an arrow with cornerRadius', () => {
+ const arrow = makeArrow({
+ length: 200,
+ headWidth: 80,
+ headLength: 80,
+ shaftWidth: 40,
+ cornerRadius: 10,
+ });
+
+ expect(arrow.width).toEqual(200);
+ expect(arrow.height).toEqual(80);
+ expect(arrow.transformOrigin).toEqual('100 40');
+ expect(arrow.path).toBeTruthy();
+ expect(arrow.instructions).toEqual(expect.any(Array));
+});
+
+test('Should be able to make an arrow with edgeRoundness', () => {
+ const arrow = makeArrow({
+ length: 200,
+ headWidth: 80,
+ headLength: 80,
+ shaftWidth: 40,
+ edgeRoundness: 0.5,
+ });
+
+ expect(arrow.width).toEqual(200);
+ expect(arrow.height).toEqual(80);
+ expect(arrow.transformOrigin).toEqual('100 40');
+ expect(arrow.path).toBeTruthy();
+ expect(arrow.instructions).toEqual(expect.any(Array));
+});