web api interface
DOMQuad
Available in workers
A DOMQuad is a collection of four DOMPoints defining the corners of an arbitrary quadrilateral. Returning DOMQuads lets getBoxQuads() return accurate information even when arbitrary 2D or 3D transforms are present. It has a handy bounds attribute returning a DOMRectReadOnly for those cases where you just want an axis-aligned bounding rectangle.
Constructor
DOMQuad()- : Creates a new
DOMQuadobject.
- : Creates a new
Instance properties
p1Read only- : A
DOMPointrepresenting one corner of theDOMQuad.
- : A
p2Read only- : A
DOMPointrepresenting one corner of theDOMQuad.
- : A
p3Read only- : A
DOMPointrepresenting one corner of theDOMQuad.
- : A
p4Read only- : A
DOMPointrepresenting one corner of theDOMQuad.
- : A
Instance methods
getBounds()- : Returns a
DOMRectobject with the coordinates and dimensions of theDOMQuadobject.
- : Returns a
toJSON()- : Returns a JSON representation of the
DOMQuadobject.
- : Returns a JSON representation of the
Static methods
DOMQuad.fromQuad()- : Returns a new
DOMQuadobject based on the provided set of coordinates in the shape of anotherDOMQuadobject.
- : Returns a new
DOMQuad.fromRect()- : Returns a new
DOMQuadobject based on the provided set of coordinates in the shape of aDOMRectobject.
- : Returns a new
Specifications
SpecificationsStandards references are available on the canonical MDN page.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.