Skip to content

🎥 Make videos programmatically with React

add negative margin example

Jonny Burgera40dba6c4532
diff --git a/packages/web-renderer/src/test/Root.tsx b/packages/web-renderer/src/test/Root.tsx
index 46f2c599d3..2a8654a103 100644
--- a/packages/web-renderer/src/test/Root.tsx
+++ b/packages/web-renderer/src/test/Root.tsx
@@ -33,6 +33,7 @@ import {textTransform} from './fixtures/text/text-transform';
import {threeLevelTransformOrigins} from './fixtures/three-level-transform-origins';
import {orthographic} from './fixtures/transforms/orthographic';
import {withMargin} from './fixtures/transforms/with-margin';
+import {withNegativeMargin} from './fixtures/transforms/with-negative-margin';
import {unwrapped} from './fixtures/unwrapped';
export const Root: React.FC = () => {
@@ -74,6 +75,7 @@ export const Root: React.FC = () => {
<Composition {...unwrapped} />
<Composition {...orthographic} />
<Composition {...withMargin} />
+ <Composition {...withNegativeMargin} />
</Folder>
</>
);
diff --git a/packages/web-renderer/src/test/fixtures/transforms/with-negative-margin.tsx b/packages/web-renderer/src/test/fixtures/transforms/with-negative-margin.tsx
new file mode 100644
index 0000000000..63d559ca8a
--- /dev/null
+++ b/packages/web-renderer/src/test/fixtures/transforms/with-negative-margin.tsx
@@ -0,0 +1,37 @@
+const WithNegativeMargin: React.FC = () => {
+ return (
+ <div
+ style={{
+ position: 'absolute',
+ inset: 0,
+ width: 1080,
+ height: 1080,
+ display: 'flex',
+ marginTop: -400,
+ transform: 'scale(0.5) rotateX(0.0001deg)',
+ }}
+ >
+ <div
+ style={{
+ position: 'absolute',
+ inset: 0,
+ width: 1080,
+ height: 1080,
+ display: 'flex',
+ flexDirection: 'column',
+ overflow: 'hidden',
+ backgroundColor: 'rgb(10, 17, 255)',
+ }}
+ />
+ </div>
+ );
+};
+
+export const withNegativeMargin = {
+ component: WithNegativeMargin,
+ id: 'with-negative-margin',
+ width: 1080,
+ height: 1080,
+ fps: 30,
+ durationInFrames: 1,
+} as const;