mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-19 11:26:02 +00:00
Previously blitHdrImageLayer rendered the source PNG at its native resolution, ignoring the CSS object-fit / object-position applied to the <img> element. With cover or contain rules, the image appeared as a small native-sized patch floating inside its layout box. Resample the decoded rgb48le buffer to the element's layout dimensions during the one-shot decode pass, applying object-fit semantics with a bilinear resampler. The downstream affine blit then treats the source as if it were already sized to the layout box, matching browser behavior. - Extend ElementStackingInfo with objectFit / objectPosition captured from getComputedStyle for HDR replaced elements. - Add resampleRgb48leObjectFit, normalizeObjectFit and helpers in alphaBlit (fill / cover / contain / none / scale-down with object-position support, opaque black slack fill). - Cache object-fit info per HDR image id and resample once during pre-decode to keep per-frame cost a memcpy + blit. Made-with: Cursor