DOMRectReadOnly.fromRect()
fromRect() は DOMRectReadOnly オブジェクトの静的メソッドで、指定された位置と大きさで新しい DOMRectReadOnly オブジェクトを作成します。
構文
js
fromRect()
fromRect(rectangle)
引数
rectangle省略可-
矩形の位置と寸法を指定するオブジェクト。すべてのプロパティは既定で
0です。プロパティは次の通りです。x: 矩形の左端の座標です。y: 矩形の上端の座標です。width: 矩形の幅です。height: 矩形の高さです。
返値
DOMRectReadOnly のインスタンスです。
仕様書
| Specification |
|---|
| Geometry Interfaces Module Level 1 # dom-domrectreadonly-fromrect |
ブラウザーの互換性
BCD tables only load in the browser