🎥 Make videos programmatically with React
Fix Studio checkerboard bleed at composition edges
Jonny Burgerc24716b726a1
diff --git a/packages/example/e2e/preview-compositing.test.mts b/packages/example/e2e/preview-compositing.test.mtsnew file mode 100644index 0000000000..68c19dfbe5--- /dev/null+++ b/packages/example/e2e/preview-compositing.test.mts@@ -0,0 +1,19 @@+import {expect, test} from '@playwright/test';+import {STUDIO_URL} from './constants.mts';+import {startStudio, stopStudio} from './studio-server.mts';++test('keeps the scaled composition on its own compositing layer', async ({+ page,+}) => {+ await startStudio();+ try {+ await page.goto(`${STUDIO_URL}/AnimatedBarChart`);+ const preview = page.locator(+ '.remotion-studio-composition-container > div',+ );+ await expect(preview).toBeVisible();+ await expect(preview).toHaveCSS('will-change', 'transform');+ } finally {+ await stopStudio();+ }+});diff --git a/packages/studio/src/components/Preview.tsx b/packages/studio/src/components/Preview.tsxindex afedcb5b4c..39c7575e9c 100644--- a/packages/studio/src/components/Preview.tsx+++ b/packages/studio/src/components/Preview.tsx@@ -72,6 +72,9 @@ const containerStyle = (options: {}): React.CSSProperties => {return {transform: `scale(${options.scale})`,+ // Keep the scaled composition on its own layer so the checkerboard does+ // not bleed through its edges at fractional preview scales.+ willChange: 'transform',marginLeft: options.xCorrection,marginTop: options.yCorrection,width: options.width,