MCPcopy Create free account
hub / github.com/Vanilagy/webcodecs-polyfill / fromRect

Method fromRect

src/dom_rect_read_only.ts:73–80  ·  view source on GitHub ↗

* Creates a DOMRectReadOnly from a DOMRectInit.

(other?: DOMRectInit)

Source from the content-addressed store, hash-verified

71 * Creates a DOMRectReadOnly from a DOMRectInit.
72 */
73 static fromRect(other?: DOMRectInit): DOMRectReadOnlyPolyfill {
74 return new DOMRectReadOnlyPolyfill(
75 other?.x ?? 0,
76 other?.y ?? 0,
77 other?.width ?? 0,
78 other?.height ?? 0,
79 );
80 }
81
82 /**
83 * Serializes the rectangle to a JSON object.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected