MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / applyCompositionSizing

Function applyCompositionSizing

packages/core/src/runtime/init.ts:321–330  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

319 const resolveRootCompositionElement = (): HTMLElement | null => findRootCompositionEl();
320
321 const applyCompositionSizing = () => {
322 const rootEl = resolveRootCompositionElement();
323 if (!rootEl) return;
324 const forcedWidth = parseDimensionPx(rootEl.getAttribute("data-width"));
325 const forcedHeight = parseDimensionPx(rootEl.getAttribute("data-height"));
326 if (forcedWidth) rootEl.style.width = forcedWidth;
327 if (forcedHeight) rootEl.style.height = forcedHeight;
328 if (forcedWidth) rootEl.style.setProperty("--comp-width", forcedWidth);
329 if (forcedHeight) rootEl.style.setProperty("--comp-height", forcedHeight);
330 };
331
332 const sanitizeCompositionDurationAttributes = () => {
333 const rootEl = resolveRootCompositionElement();

Callers 1

postTimelineFunction · 0.85

Calls 4

parseDimensionPxFunction · 0.85
setPropertyMethod · 0.80
getAttributeMethod · 0.65

Tested by

no test coverage detected