DOMPointReadOnly extension type
The DOMPointReadOnly
interface specifies the coordinate and
perspective fields used by DOMPoint to define a 2D or 3D point in a
coordinate system.
There are two ways to create a new DOMPointReadOnly
instance. First, you
can use its constructor, passing in the values of the parameters for each
dimension and, optionally, the perspective:
/* 2D */
const point2D = new DOMPointReadOnly(50, 50);
/* 3D */
const point3D = new DOMPointReadOnly(50, 50, 25);
/* 3D with perspective */
const point3DPerspective = new DOMPointReadOnly(100, 100, 100, 1.0);
The other option is to use the static DOMPointReadOnly.fromPoint_static
method:
const point = DOMPointReadOnly.fromPoint({ x: 100, y: 100, z: 50, w: 1.0 });
API documentation sourced from MDN Web Docs.
- on
- Implemented types
- Available extensions
Constructors
- DOMPointReadOnly([num x, num y, num z, num w])
-
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- w → double
-
The
DOMPointReadOnly
interface'sw
property holds the point's perspective value,w
, for a read-only point in space.no setter - x → double
-
The
DOMPointReadOnly
interface'sx
property holds the horizontal coordinate, x, for a read-only point in space. This property cannot be changed by JavaScript code in this read-only version of theDOMPoint
object.no setter - y → double
-
The
DOMPointReadOnly
interface'sy
property holds the vertical coordinate, y, for a read-only point in space.no setter - z → double
-
The
DOMPointReadOnly
interface'sz
property holds the depth coordinate, z, for a read-only point in space.no setter
Methods
-
matrixTransform(
[DOMMatrixInit matrix]) → DOMPoint -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJSON(
) → JSObject -
The DOMPointReadOnly method
toJSON()
returns an object giving the form of the point object. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
fromPoint(
[DOMPointInit other]) → DOMPointReadOnly -
The static DOMPointReadOnly
method
fromPoint()
creates and returns a newDOMPointReadOnly
object given a source point.