MDN self-hosted library · e01.org

DOMQuad

Geometry Interfaces

no runnable cells web-api-interface upstream source

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 DOMQuad object.

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 DOMQuad object based on the provided set of coordinates in the shape of another DOMQuad object.
  • DOMQuad.fromRect()
  • : Returns a new DOMQuad object 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 DOMQuad object.
  • DOMQuad.toJSON()
  • : Returns a JSON-serializable plain object representing the DOMQuad object. Automatically called by JSON.stringify().

Specifications

Browser compatibility