Table of Contents

Class DOMQuad

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

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.

[Value("DOMQuad")]
public class DOMQuad
Inheritance
DOMQuad
Inherited Members

Remarks

Constructors

DOMQuad()

public DOMQuad()

DOMQuad(DOMPointInit, DOMPointInit, DOMPointInit, DOMPointInit)

The DOMQuad() constructor
creates and returns a new DOMQuad object, given the values for some or
all of its properties.

public DOMQuad(DOMPointInit p1 = null, DOMPointInit p2 = null, DOMPointInit p3 = null, DOMPointInit p4 = null)

Parameters

p1 DOMPointInit
p2 DOMPointInit
p3 DOMPointInit
p4 DOMPointInit

Remarks

You can also create a DOMQuad by calling the
FromRect(DOMRectInit) or FromQuad(DOMQuadInit) static function. That function accepts any object with the required parameters, including a DOMQuad, DOMPoint or
DOMPointReadOnly.

-DOMPoint
-DOMRect
-DOMMatrix

See also on MDN

Properties

P1

The DOMQuad interface's p1 property holds the DOMPoint object that represents one of the four corners of the DOMQuad. When created from FromRect(DOMRectInit), it is the point (x, y).

[Value("p1")]
public DOMPoint P1 { get; }

Property Value

DOMPoint

The DOMPoint object includes the following double-precision floating-point values:Each of these values is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be GlobalObject.NaN or GlobalObject.Infinity).

Remarks

-The other DOMPoint properties: P2,
P3, and P4.

See also on MDN

P2

The DOMQuad interface's p2 property holds the DOMPoint object that represents one of the four corners of the DOMQuad. When created from FromRect(DOMRectInit), it is the point (x + width, y).

[Value("p2")]
public DOMPoint P2 { get; }

Property Value

DOMPoint

The DOMPoint object includes the following double-precision floating-point values:Each of these values is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be GlobalObject.NaN or GlobalObject.Infinity).

Remarks

-The other DOMPoint properties: P1,
P3, and P4.

See also on MDN

P3

The DOMQuad interface's p3 property holds the DOMPoint object that represents one of the four corners of the DOMQuad. When created from FromRect(DOMRectInit), it is the point (x + width, y + height).

[Value("p3")]
public DOMPoint P3 { get; }

Property Value

DOMPoint

The DOMPoint object includes the following double-precision floating-point values:Each of these values is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be GlobalObject.NaN or GlobalObject.Infinity).

Remarks

-The other DOMPoint properties: P1,
P2, and P4.

See also on MDN

P4

The DOMQuad interface's p4 property holds the DOMPoint object that represents one of the four corners of the DOMQuad. When created from FromRect(DOMRectInit), it is the point (x, y + height).

[Value("p4")]
public DOMPoint P4 { get; }

Property Value

DOMPoint

The DOMPoint object includes the following double-precision floating-point values:Each of these values is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be GlobalObject.NaN or GlobalObject.Infinity).

Remarks

-The other DOMPoint properties: P1,
P2, and P3.

See also on MDN

Methods

FromQuad(DOMQuadInit)

[Value("fromQuad")]
public static DOMQuad FromQuad(DOMQuadInit other = null)

Parameters

other DOMQuadInit

Returns

DOMQuad

FromRect(DOMRectInit)

[Value("fromRect")]
public static DOMQuad FromRect(DOMRectInit other = null)

Parameters

other DOMRectInit

Returns

DOMQuad

GetBounds()

The DOMQuad method
getBounds() returns a DOMRect object representing the smallest rectangle that fully contains the DOMQuad object.

[Value("getBounds")]
public DOMRect GetBounds()

Returns

DOMRect

A DOMRect with the x, y, width, and height properties, defining the bounding box for the DOMQuad based on its corner coordinates.

Remarks

ToJSON()

The DOMQuad method
toJSON() returns a
JSON representation of the DOMQuad object.

[Value("toJSON")]
public Object ToJSON()

Returns

Object

A new object whose properties are set to the values in the
DOMQuad on which the method was called.

Remarks