mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-23 11:29:54 +00:00
offsetWidth/offsetHeight are only defined on HTMLElement (not on SVGElement, MathMLElement, etc.). Casting unconditionally can yield undefined-by-runtime even though TypeScript thinks otherwise. Use an instanceof check and fall back to the bounding rect dimensions when the element is not an HTMLElement. Addresses deferred review feedback from PR #290.