-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
@remotion/web-renderer: Fix margins being applied twice
#5968
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
f299edb
make a test for bad transforms
JonnyBurger 23ff9ea
fix issue
JonnyBurger d774470
`@remotion/web-renderer`: Fix `margins` beign applied twice
JonnyBurger 3cfdbda
Update transforms.test.tsx
JonnyBurger 4f6f0dd
fix a problem with it
JonnyBurger ca696fb
fix an example
JonnyBurger 9f4c558
infra for using studio
JonnyBurger fc39975
test cases
JonnyBurger bee94c7
fix tests
JonnyBurger a746c99
fix stuff
JonnyBurger 35a20db
Update compose.ts
JonnyBurger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| // bun run studio | ||
| import React from 'react'; | ||
| import {Composition} from 'remotion'; | ||
| import {evenHarderCase} from './fixtures'; | ||
| import {transformOriginFixture} from './transform-origin-fixture'; | ||
|
|
||
| export const Root: React.FC = () => { | ||
| return ( | ||
| <> | ||
| <Composition {...evenHarderCase} /> | ||
| <Composition {...transformOriginFixture} /> | ||
| </> | ||
| ); | ||
| }; |
Binary file added
BIN
+9.95 KB
...est/__screenshots__/transforms.test.tsx/complicated-example-chromium-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+15.6 KB
...test/__screenshots__/transforms.test.tsx/complicated-example-firefox-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.6 KB
.../test/__screenshots__/transforms.test.tsx/complicated-example-webkit-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.2 KB
...c/test/__screenshots__/transforms.test.tsx/even-harder-case-chromium-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.91 KB
...rc/test/__screenshots__/transforms.test.tsx/even-harder-case-firefox-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.34 KB
...src/test/__screenshots__/transforms.test.tsx/even-harder-case-webkit-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| import {AbsoluteFill} from 'remotion'; | ||
|
|
||
| const Component: React.FC = () => { | ||
| return ( | ||
| <AbsoluteFill> | ||
| <AbsoluteFill | ||
| style={{ | ||
| width: 1080, | ||
| height: 1080, | ||
| justifyContent: 'center', | ||
| alignItems: 'center', | ||
| }} | ||
| > | ||
| <div | ||
| style={{ | ||
| position: 'absolute', | ||
| inset: 0, | ||
| width: '100%', | ||
| height: '100%', | ||
| display: 'flex', | ||
| flexDirection: 'column', | ||
| overflow: 'hidden', | ||
| }} | ||
| > | ||
| <div | ||
| style={{ | ||
| position: 'absolute', | ||
| inset: 0, | ||
| width: '100%', | ||
| height: '100%', | ||
| display: 'flex', | ||
| }} | ||
| > | ||
| <div | ||
| style={{ | ||
| position: 'absolute', | ||
| inset: 0, | ||
| width: '100%', | ||
| height: '100%', | ||
| display: 'flex', | ||
| transformOrigin: 'center center', | ||
| transform: | ||
| 'scale(0.68) translateX(-525.043px) translateY(52.1668px)', | ||
| }} | ||
| > | ||
| <div | ||
| style={{ | ||
| position: 'absolute', | ||
| inset: 0, | ||
| width: '100%', | ||
| height: '100%', | ||
| display: 'flex', | ||
| justifyContent: 'center', | ||
| alignItems: 'center', | ||
| }} | ||
| > | ||
| <svg | ||
| width={104.4} | ||
| height={104.4} | ||
| viewBox="0 0 104.39999999999999 104.39999999999999" | ||
| xmlns="http://www.w3.org/2000/svg" | ||
| style={{ | ||
| marginLeft: -19.4897, | ||
| }} | ||
| > | ||
| <path | ||
| d="M 52.199999999999996 0 C 86.46666752667024 0 104.39999999999999 17.933332473329756 104.39999999999999 52.199999999999996 C 104.39999999999999 86.46666752667024 86.46666752667024 104.39999999999999 52.199999999999996 104.39999999999999 C 17.933332473329756 104.39999999999999 0 86.46666752667024 0 52.199999999999996 C 0 17.933332473329756 17.933332473329756 0 52.199999999999996 0 Z" | ||
| fill="rgba(216, 68, 30, 1)" | ||
| /> | ||
| </svg> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </AbsoluteFill> | ||
| </AbsoluteFill> | ||
| ); | ||
| }; | ||
|
|
||
| export const evenHarderCase = { | ||
| component: Component, | ||
| id: 'even-harder-case', | ||
| width: 550, | ||
| height: 700, | ||
| fps: 30, | ||
| durationInFrames: 100, | ||
| } as const; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| import {registerRoot} from 'remotion'; | ||
| import {Root} from './Root'; | ||
|
|
||
| registerRoot(Root); |
33 changes: 33 additions & 0 deletions
33
packages/web-renderer/src/test/transform-origin-fixture.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| import {AbsoluteFill} from 'remotion'; | ||
|
|
||
| const Component: React.FC = () => { | ||
| return ( | ||
| <AbsoluteFill | ||
| style={{ | ||
| transform: 'rotate(25deg)', | ||
| transformOrigin: '10px 10px', | ||
| }} | ||
| > | ||
| <svg | ||
| viewBox="0 0 100 100" | ||
| width="100" | ||
| height="100" | ||
| style={{ | ||
| transform: 'rotate(-25deg) scale(0.8)', | ||
| transformOrigin: '90px 10px', | ||
| }} | ||
| > | ||
| <polygon points="50,10 90,90 10,90" fill="orange" /> | ||
| </svg> | ||
| </AbsoluteFill> | ||
| ); | ||
| }; | ||
|
|
||
| export const transformOriginFixture = { | ||
| component: Component, | ||
| id: 'transform-origin-fixture', | ||
| width: 100, | ||
| height: 100, | ||
| fps: 30, | ||
| durationInFrames: 100, | ||
| } as const; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.