DOMMatrixReadOnly: is2D-Eigenschaft

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.

Hinweis: Diese Funktion ist in Web Workers verfügbar.

Die schreibgeschützte is2D-Eigenschaft des DOMMatrixReadOnly-Interfaces ist ein boolesches Flag, das true ist, wenn die Matrix 2D ist. Der Wert ist true, wenn die Matrix als 2D-Matrix initialisiert wurde und nur 2D-Transformationen angewendet wurden. Andernfalls ist die Matrix in 3D definiert und is2D ist false.

Wert

Ein boolescher Wert.

Beispiele

js
// Initialize a 2D matrix
const matrix = new DOMMatrix(); // create a matrix
console.log(matrix.is2D); // output: true

// Transform in a 2D space
console.log(matrix.rotate(30).is2D); // output: true

// Apply a 3D transform
console.log(matrix.rotate(10, 20, 1).is2D); // output: false

Spezifikationen

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

Browser-Kompatibilität

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
is2D

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

Siehe auch