Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. DOMMatrixReadOnly
  4. is2D

DOMMatrixReadOnly: is2D property

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨January 2020⁩.

Note: This feature is available inWeb Workers.

The readonlyis2D property of theDOMMatrixReadOnly interface is a Boolean flag that istrue when the matrix is 2D. The value istrue if the matrix was initialized as a 2D matrix and only 2D transformation operations were applied. Otherwise, the matrix is defined in 3D, andis2D isfalse.

Value

A Boolean value.

Examples

js
// Initialize a 2D matrixconst matrix = new DOMMatrix(); // create a matrixconsole.log(matrix.is2D); // output: true// Transform in a 2D spaceconsole.log(matrix.rotate(30).is2D); // output: true// Apply a 3D transformconsole.log(matrix.rotate(10, 20, 1).is2D); // output: false

Specifications

Specification
Geometry Interfaces Module Level 1
# dom-dommatrixreadonly-is2d

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp