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

Function computeDraftPosition

packages/sdk/src/adapters/iframe.ts:79–88  ·  view source on GitHub ↗
(
  dataX: string | null,
  dataY: string | null,
  dx: number,
  dy: number,
)

Source from the content-addressed store, hash-verified

77 * `data-x` / `data-y` default to 0 when absent or non-numeric.
78 */
79export function computeDraftPosition(
80 dataX: string | null,
81 dataY: string | null,
82 dx: number,
83 dy: number,
84): { x: number; y: number } {
85 const baseX = parseFloat(dataX ?? "0") || 0;
86 const baseY = parseFloat(dataY ?? "0") || 0;
87 return { x: baseX + dx, y: baseY + dy };
88}
89
90// ─── Image-alpha pure helpers (WS-G phase 1) ──────────────────────────────────
91

Callers 2

commitPreviewMethod · 0.85
iframe.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected