DOMQuad
Geometry Interfaces
Geometry Interfaces
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.
Instance properties
- DOMQuad.p1
- : A DOMPoint representing one corner of the
DOMQuad. - DOMQuad.p2
- : A DOMPoint representing one corner of the
DOMQuad. - DOMQuad.p3
- : A DOMPoint representing one corner of the
DOMQuad. - DOMQuad.p4
- : A DOMPoint representing one corner of the
DOMQuad.
Static methods
- DOMQuad.fromQuad()
- : Returns a new
DOMQuadobject based on the provided set of coordinates in the shape of anotherDOMQuadobject. - DOMQuad.fromRect()
- : Returns a new
DOMQuadobject based on the provided set of coordinates in the shape of a DOMRect object.
Instance methods
- DOMQuad.getBounds()
- : Returns a DOMRect object with the coordinates and dimensions of the
DOMQuadobject. - DOMQuad.toJSON()
- : Returns a JSON-serializable plain object representing the
DOMQuadobject. Automatically called by JSON.stringify().