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
p1DOMPointInitp2DOMPointInitp3DOMPointInitp4DOMPointInit
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.
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
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
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
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
Methods
FromQuad(DOMQuadInit)
[Value("fromQuad")]
public static DOMQuad FromQuad(DOMQuadInit other = null)
Parameters
otherDOMQuadInit
Returns
FromRect(DOMRectInit)
[Value("fromRect")]
public static DOMQuad FromRect(DOMRectInit other = null)
Parameters
otherDOMRectInit
Returns
GetBounds()
The DOMQuad methodgetBounds() 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
DOMQuadbased on its corner coordinates.
Remarks
ToJSON()
[Value("toJSON")]
public Object ToJSON()
Returns
- Object
A new object whose properties are set to the values in the
DOMQuadon which the method was called.