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() #
SVGMatrix flipX();
Code SVGMatrix flipY() #
SVGMatrix flipY();
Code SVGMatrix inverse() #
Return the inverse matrix
Exceptions:
- a
DOMException
with codeSVG_MATRIX_NOT_INVERTABLE
is raised if the matrix is not invertable.
SVGMatrix inverse();
Code SVGMatrix multiply(SVGMatrix secondMatrix) #
SVGMatrix multiply(SVGMatrix secondMatrix);
Code SVGMatrix rotate(num angle) #
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 codeSVG_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) #
SVGMatrix scale(num scaleFactor);
Code SVGMatrix scaleNonUniform(num scaleFactorX, num scaleFactorY) #
SVGMatrix scaleNonUniform(num scaleFactorX, num scaleFactorY);
Code SVGMatrix skewX(num angle) #
SVGMatrix skewX(num angle);
Code SVGMatrix skewY(num angle) #
SVGMatrix skewY(num angle);
Code SVGMatrix translate(num x, num y) #
SVGMatrix translate(num x, num y);
Fields
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.