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 point = new DOMPointReadOnly(50, 50); /* 3D */ const point = new DOMPointReadOnly(50, 50, 25); /* 3D with perspective */ const point = new DOMPointReadOnly(100, 100, 100, 1.0);
The other option is to use the static
DOMPointReadOnly.fromPoint()
方法:
const point = DOMPointReadOnly.fromPoint({x: 100, y: 100, z: 50; w: 1.0});
DOMPointReadOnly()
DOMPointReadOnly
object given the values of its coordinates and perspective. To create a point using a
DOMPointInit
object, you can instead use
DOMPointReadOnly.fromPoint()
.
DOMPointReadOnly.x
只读
x
.
DOMPointReadOnly.y
只读
y
.
DOMPointReadOnly.z
只读
z
.
DOMPointReadOnly.w
只读
w
.
DOMPointReadOnly.fromPoint()
DOMPointReadOnly
object given the coordinates provided in the specified
DOMPointInit
对象。
matrixTransform()
DOMMatrixInit
对象到
DOMPointReadOnly
对象。
toJSON()
DOMPointReadOnly
对象。
| 规范 | 状态 | 注释 |
|---|---|---|
|
Geometry Interfaces Module Level 1
The definition of 'DOMPoint' in that specification. |
候选推荐 | Latest spec version is an ED. |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
DOMPointReadOnly
|
Chrome 61 | Edge 79 | Firefox 31 | IE No | Opera 48 | Safari 10.1 | WebView Android 61 | Chrome Android 61 | Firefox Android 31 | Opera Android 45 | Safari iOS 10.3 | Samsung Internet Android 8.0 |
DOMPointReadOnly()
构造函数
|
Chrome 61 | Edge 79 | Firefox 31 | IE No | Opera 48 | Safari 10.1 | WebView Android 61 | Chrome Android 61 | Firefox Android 31 | Opera Android 45 | Safari iOS 10.3 | Samsung Internet Android 8.0 |
fromPoint()
static function
|
Chrome 61 | Edge 79 | Firefox 31 | IE No | Opera 48 | Safari 10.1 | WebView Android 61 | Chrome Android 61 | Firefox Android 31 | Opera Android 45 | Safari iOS 10.3 | Samsung Internet Android 8.0 |
matrixTransform()
弃用
|
Chrome 61 | Edge 79 | Firefox 31 | IE No | Opera 48 | Safari 10.1 | WebView Android 61 | Chrome Android 61 | Firefox Android 31 | Opera Android 45 | Safari iOS 10.3 | Samsung Internet Android 8.0 |
toJSON()
|
Chrome 61 | Edge 79 | Firefox 62 | IE No | Opera 48 | Safari 10.1 | WebView Android 61 | Chrome Android 61 | Firefox Android 62 | Opera Android 45 | Safari iOS 10.3 | Samsung Internet Android 8.0 |
w
|
Chrome 61 | Edge 79 | Firefox 31 | IE No | Opera 48 | Safari 10.1 | WebView Android 61 | Chrome Android 61 | Firefox Android 31 | Opera Android 45 | Safari iOS 10.3 | Samsung Internet Android 8.0 |
| Available in workers | Chrome 61 | Edge 79 | Firefox 69 | IE No | Opera 48 | Safari 10.1 | WebView Android 61 | Chrome Android 61 | Firefox Android No | Opera Android 45 | Safari iOS 10.3 | Samsung Internet Android 8.0 |
x
|
Chrome 61 | Edge 79 | Firefox 31 | IE No | Opera 48 | Safari 10.1 | WebView Android 61 | Chrome Android 61 | Firefox Android 31 | Opera Android 45 | Safari iOS 10.3 | Samsung Internet Android 8.0 |
y
|
Chrome 61 | Edge 79 | Firefox 31 | IE No | Opera 48 | Safari 10.1 | WebView Android 61 | Chrome Android 61 | Firefox Android 31 | Opera Android 45 | Safari iOS 10.3 | Samsung Internet Android 8.0 |
z
|
Chrome 61 | Edge 79 | Firefox 31 | IE No | Opera 48 | Safari 10.1 | WebView Android 61 | Chrome Android 61 | Firefox Android 31 | Opera Android 45 | Safari iOS 10.3 | Samsung Internet Android 8.0 |
完整支持
不支持
弃用。不要用于新网站。
DOMPointReadOnly