Skip to content

Conversation

@JonnyBurger
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings November 18, 2025 12:30
@vercel
Copy link
Contributor

vercel bot commented Nov 18, 2025

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

Project Deployment Preview Comments Updated (UTC)
bugs Ready Ready Preview Comment Nov 20, 2025 2:39pm
remotion Ready Ready Preview Comment Nov 20, 2025 2:39pm

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a bug where margins on SVG elements were being applied twice during rendering in the @remotion/web-renderer package. The fix sets margins to '0' before serializing the SVG, since margins are already included in positioning calculations.

Key changes:

  • Added margin reset logic in svgToImageBitmap function to prevent double-counting
  • Added a comprehensive test case with nested transforms and margins to verify the fix
  • Updated test viewport height from 720 to 1080 to accommodate the new 1080x1080 test composition

Reviewed Changes

Copilot reviewed 3 out of 6 changed files in this pull request and generated 3 comments.

File Description
packages/web-renderer/src/compose-svg.ts Added margin reset (marginLeft, marginRight, marginTop, marginBottom) before SVG serialization to fix double-counting issue
packages/web-renderer/src/test/transforms.test.tsx Added new test case "complicated example" with nested transforms and SVG elements using margins to verify the fix
packages/web-renderer/vitest.config.ts Increased viewport height from 720 to 1080 pixels across all browser configs to support the new test dimensions
packages/web-renderer/src/test/screenshots/*.png Added visual regression test snapshots for the new test across different browsers (chromium, firefox, webkit)

@JonnyBurger JonnyBurger merged commit 93dd400 into main Nov 20, 2025
16 checks passed
@JonnyBurger JonnyBurger deleted the web-renderer-fix-transforms branch November 20, 2025 14:41
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.

2 participants