Dart API Referencedart:htmlSVGMatrix

SVGMatrix Interface

Many of SVG's graphics operations utilize 2x3 matrices of the form:

[a c e]
[b d f]

which, when expanded into a 3x3 matrix for the purposes of matrix arithmetic, become:

[a c e]
[b d f]
[0 0 1]

An SVGMatrix object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown.

Methods

Code SVGMatrix flipX() #

Post-multiplies the transformation [-1 0 0 1 0 0] and returns the resulting matrix.
SVGMatrix flipX();

Code SVGMatrix flipY() #

Post-multiplies the transformation [1 0 0 -1 0 0] and returns the resulting matrix.
SVGMatrix flipY();

Code SVGMatrix inverse() #

Return the inverse matrix

Exceptions:

  • a DOMException with code SVG_MATRIX_NOT_INVERTABLE is raised if the matrix is not invertable.
SVGMatrix inverse();

Code SVGMatrix multiply(SVGMatrix secondMatrix) #

Performs matrix multiplication. This matrix is post-multiplied by another matrix, returning the resulting new matrix.
SVGMatrix multiply(SVGMatrix secondMatrix);

Code SVGMatrix rotate(num angle) #

Post-multiplies a rotation transformation on the current matrix and returns the resulting matrix.
SVGMatrix rotate(num angle);

Code SVGMatrix rotateFromVector(num x, num y) #

Post-multiplies a rotation transformation on the current matrix and returns the resulting matrix. The rotation angle is determined by taking (+/-) atan(y/x). The direction of the vector (x, y) determines whether the positive or negative angle value is used.

Exceptions:

  • a DOMException with code SVG_INVALID_VALUE_ERR is raised if one of the parameters has an invalid value.
SVGMatrix rotateFromVector(num x, num y);

Code SVGMatrix scale(num scaleFactor) #

Post-multiplies a uniform scale transformation on the current matrix and returns the resulting matrix.
SVGMatrix scale(num scaleFactor);

Code SVGMatrix scaleNonUniform(num scaleFactorX, num scaleFactorY) #

Post-multiplies a non-uniform scale transformation on the current matrix and returns the resulting matrix.
SVGMatrix scaleNonUniform(num scaleFactorX, num scaleFactorY);

Code SVGMatrix skewX(num angle) #

Post-multiplies a skewX transformation on the current matrix and returns the resulting matrix.
SVGMatrix skewX(num angle);

Code SVGMatrix skewY(num angle) #

Post-multiplies a skewY transformation on the current matrix and returns the resulting matrix.
SVGMatrix skewY(num angle);

Code SVGMatrix translate(num x, num y) #

Post-multiplies a translation transformation on the current matrix and returns the resulting matrix.
SVGMatrix translate(num x, num y);

Fields

Code num a #

num a;

Code num b #

num b;

Code num c #

num c;

Code num d #

num d;

Code num e #

num e;

Code num f #

num f;

This page includes content from the Mozilla Foundation that is graciously licensed under a Creative Commons: Attribution-Sharealike license. Mozilla has no other association with Dart or dartlang.org. We encourage you to improve the web by contributing to The Mozilla Developer Network.