DOMMatrixReadOnly: skewX()-Methode

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.

We’d love to hear your thoughts on the next set of proposals for the JavaScript language. You can find a description of the proposals here.
Please take two minutes to fill out our short survey.

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

Die skewX()-Methode der DOMMatrixReadOnly-Schnittstelle gibt eine neue DOMMatrix zurück, die durch Anwenden der angegebenen Schertransformation auf die Quellmatrix entlang ihrer x-Achse erstellt wurde. Die ursprüngliche Matrix wird nicht verändert.

Um die Matrix zu ändern, während Sie sie entlang der x-Achse scheren, siehe DOMMatrix.skewXSelf().

Syntax

js
skewX()
skewX(sX)

Parameter

sX

Eine Zahl; der Winkel, in Grad, um den die Matrix entlang der x-Achse geschert wird.

Rückgabewert

Eine DOMMatrix.

Beispiele

js
const matrix = new DOMMatrix(); // create a matrix
console.log(matrix.toString()); // no transform applied
// "matrix(1, 0, 0, 1, 0, 0)"

console.log(matrix.skewX(14).toString());
//"matrix(1, 0, 0.25, 1, 0, 0)"

console.log(matrix.toString()); // original is unchanged
// "matrix(1, 0, 0, 1, 0, 0)"

Spezifikationen

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

Browser-Kompatibilität

Siehe auch