Skip to content

@remotion/studio: Parse rotation values directly to preserve angles beyond 360°#6943

Merged
JonnyBurger merged 1 commit intomainfrom
fix/rotation-field-no-wrap
Mar 31, 2026
Merged

@remotion/studio: Parse rotation values directly to preserve angles beyond 360°#6943
JonnyBurger merged 1 commit intomainfrom
fix/rotation-field-no-wrap

Conversation

@JonnyBurger
Copy link
Copy Markdown
Member

Summary

  • The timeline rotation field was wrapping 360° back to 0° because it used DOMMatrix + atan2 to parse rotation values, which loses information about full rotations
  • Now parses deg, rad, turn, and grad unit strings directly to preserve the original numeric value
  • Falls back to the DOMMatrix approach for unrecognized formats

Test plan

  • Set a rotation to 360°, 720°, or other multiples — verify the field displays the correct value instead of wrapping to 0°
  • Verify negative rotations still work correctly
  • Verify rad, turn, grad units parse correctly

🤖 Generated with Claude Code

… beyond 360°

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@pullfrog
Copy link
Copy Markdown
Contributor

pullfrog bot commented Mar 31, 2026

Reviewed PR #6943 — the approach is sound. Left one comment about the regex not handling + prefixed or bare-decimal CSS number forms (e.g. +720deg, .5turn), which would silently fall through to the DOMMatrix path and re-introduce the wrapping bug for values ≥ 360°.

Task list (4/4 completed)
  • Checkout PR and read diff
  • Review changed file and trace logic
  • Investigate surrounding code for context
  • Submit review or report progress

Pullfrog  | View workflow run | Triggered by Pullfrog | Using Big Pickle (free) | 𝕏

@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Mar 31, 2026

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

Project Deployment Actions Updated (UTC)
bugs Ready Ready Preview, Comment Mar 31, 2026 0:58am
remotion Ready Ready Preview, Comment Mar 31, 2026 0:58am

Request Review

Copy link
Copy Markdown
Contributor

@pullfrog pullfrog bot left a comment

Choose a reason for hiding this comment

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

Clean fix — direct parsing avoids DOMMatrix's inherent angle normalization. One minor robustness gap in the regex patterns.

Pullfrog  | Fix all ➔Fix 👍s ➔View workflow run | Using Big Pickle (free) | 𝕏

@pullfrog
Copy link
Copy Markdown
Contributor

pullfrog bot commented Mar 31, 2026

Addressed the review feedback by broadening the rotation regex to accept all valid CSS <number> forms (+720deg, .5deg, -.5deg) and consolidating four separate unit regexes into a single shared unitPattern + unitToDegrees lookup. Since PR #6943 was already merged, the fix is in follow-up PR #6946.

Task list (3/3 completed)
  • Broaden regex patterns to accept +, leading dot, and bare decimal forms
  • Consolidate into a single shared regex for all units
  • Verify diff, commit, push, and reply to review

Pullfrog  | View workflow run | Triggered by Pullfrog | Using Big Pickle (free) | 𝕏

@JonnyBurger JonnyBurger merged commit 3e18d28 into main Mar 31, 2026
19 of 20 checks passed
@JonnyBurger JonnyBurger deleted the fix/rotation-field-no-wrap branch March 31, 2026 13:07
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.

1 participant