Skip to content

@remotion/shapes: clamp makeCallout corner radius to adjacent edge lengths - #13577

Merged
JonnyBurger merged 1 commit into
remotion-dev:mainfrom
TbhVishal:fix/make-callout-corner-radius-clamp
Nov 24, 2026
Merged

JonnyBurger merged 1 commit into
remotion-dev:mainfrom
TbhVishal:fix/make-callout-corner-radius-clamp

Conversation

@TbhVishal

Copy link
Copy Markdown
Contributor

Fixes #13448

When cornerRadius is larger than half an edge or the segment between the corner and the pointer base, makeInstructions applied the raw radius at every rounded vertex without clamping, causing arcs to overshoot the callout body or cross over the pointer opening.

This clamps each rounded corner radius to half the length of edges shared with adjacent rounded corners, and to the full length of edges meeting an unrounded pointer base vertex.

To test locally:

bun test packages/shapes/src/test/make-callout.test.ts

@vercel

vercel Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
bugs Ready Ready Preview Nov 23, 2026 8:49am UTC
remotion Ready Ready Preview Nov 23, 2026 8:49am UTC

Request Review

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Approach: Sound — clamping each rounded corner against its adjacent segments prevents overshoot while preserving sharp pointer vertices.

Reviewed changes: Reviewed the callout geometry and regression coverage; the shapes test suite passes.

  • Radius limits: Clamp each corner based on neighboring rounded or sharp vertices.
  • Regression coverage: Check oversized radii and pointers near a corner.

Pullfrog  | View workflow run | Using gpt-6.1-terra | 𝕏

@JonnyBurger JonnyBurger changed the title fix(shapes): clamp makeCallout corner radius to adjacent edge lengths @remotion/shapes: clamp makeCallout corner radius to adjacent edge lengths Nov 24, 2026
@JonnyBurger
JonnyBurger merged commit 7e95f96 into remotion-dev:main Nov 24, 2026
22 checks passed

This branch was successfully deployed

2 active deployments
Preview – remotion — 0b993580 Deployed Nov 23, 2026 by vercel[bot]
Preview – bugs — 0b993580 Deployed Nov 23, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@remotion/shapes: makeCallout() draws outside its box when cornerRadius exceeds half a side or the segment next to the pointer

2 participants