Skip to content

🎥 Make videos programmatically with React

Implement support for background-clip

Jonny Burger18c4d7fa977c
diff --git a/packages/web-renderer/src/drawing/draw-background.ts b/packages/web-renderer/src/drawing/draw-background.ts
index aeb21397b8..e98510cb6b 100644
--- a/packages/web-renderer/src/drawing/draw-background.ts
+++ b/packages/web-renderer/src/drawing/draw-background.ts
@@ -53,8 +53,6 @@ export const drawBackground = async ({
backgroundClip,
);
- console.log(boundingRects);
-
for (const boundingRect of boundingRects) {
if (backgroundClip.includes('text')) {
offsetLeft = boundingRect.left;
@@ -94,7 +92,7 @@ export const drawBackground = async ({
boundingRect.height,
);
contextToDraw.fillStyle = originalFillStyle;
- return finish();
+ continue;
}
}
diff --git a/packages/web-renderer/src/test/__screenshots__/background-clip.test.tsx/background-clip-text-chromium-darwin.png b/packages/web-renderer/src/test/__screenshots__/background-clip.test.tsx/background-clip-text-chromium-darwin.png
index fa7a8635c5..8c02279419 100644
Binary files a/packages/web-renderer/src/test/__screenshots__/background-clip.test.tsx/background-clip-text-chromium-darwin.png and b/packages/web-renderer/src/test/__screenshots__/background-clip.test.tsx/background-clip-text-chromium-darwin.png differ
diff --git a/packages/web-renderer/src/test/__screenshots__/background-clip.test.tsx/background-clip-text-firefox-darwin.png b/packages/web-renderer/src/test/__screenshots__/background-clip.test.tsx/background-clip-text-firefox-darwin.png
index afea0a443d..aef2f4b3c9 100644
Binary files a/packages/web-renderer/src/test/__screenshots__/background-clip.test.tsx/background-clip-text-firefox-darwin.png and b/packages/web-renderer/src/test/__screenshots__/background-clip.test.tsx/background-clip-text-firefox-darwin.png differ
diff --git a/packages/web-renderer/src/test/__screenshots__/background-clip.test.tsx/background-clip-text-webkit-darwin.png b/packages/web-renderer/src/test/__screenshots__/background-clip.test.tsx/background-clip-text-webkit-darwin.png
index cec2ac61cb..dcba7929ed 100644
Binary files a/packages/web-renderer/src/test/__screenshots__/background-clip.test.tsx/background-clip-text-webkit-darwin.png and b/packages/web-renderer/src/test/__screenshots__/background-clip.test.tsx/background-clip-text-webkit-darwin.png differ
diff --git a/packages/web-renderer/src/test/fixtures/text/background-clip-text.tsx b/packages/web-renderer/src/test/fixtures/text/background-clip-text.tsx
index eda62042a4..a59c78224f 100644
--- a/packages/web-renderer/src/test/fixtures/text/background-clip-text.tsx
+++ b/packages/web-renderer/src/test/fixtures/text/background-clip-text.tsx
@@ -2,14 +2,15 @@ import React from 'react';
import {AbsoluteFill} from 'remotion';
const baseStyle: React.CSSProperties = {
- border: '0.8em darkviolet',
- borderStyle: 'dashed',
+ border: '0.8em rgba(0, 0, 0, 0.2)',
+ borderStyle: 'solid',
margin: '1em 0',
padding: '1.4em',
background: 'linear-gradient(60deg, red, yellow, red, yellow, red)',
fontWeight: 900,
fontSize: '1.2em',
fontFamily: 'sans-serif',
+ borderRadius: 20,
};
const Component: React.FC = () => {