Interface SVGTransform
angle: number;
matrix: DOMMatrix;
SVG_TRANSFORM_MATRIX: 1;
SVG_TRANSFORM_ROTATE: 4;
SVG_TRANSFORM_SCALE: 3;
SVG_TRANSFORM_SKEWX: 5;
SVG_TRANSFORM_SKEWY: 6;
SVG_TRANSFORM_TRANSLATE: 2;
SVG_TRANSFORM_UNKNOWN: 0;
type: number;
setMatrix(matrix?: DOMMatrix2DInit): void;
setRotate(angle: number, cx: number, cy: number): void;
setScale(sx: number, sy: number): void;
setSkewX(angle: number): void;
setSkewY(angle: number): void;
setTranslate(tx: number, ty: number): void;
}
Properties
Readonlyangle
The angle read-only property of the SVGTransform interface represents the angle of the transformation in degrees.
Readonlymatrix
The matrix read-only property of the SVGTransform interface represents the transformation matrix that corresponds to the transformation type.
ReadonlySVG_TRANSFORM_MATRIX
ReadonlySVG_TRANSFORM_ROTATE
ReadonlySVG_TRANSFORM_SCALE
ReadonlySVG_TRANSFORM_SKEWX
ReadonlySVG_TRANSFORM_SKEWY
ReadonlySVG_TRANSFORM_TRANSLATE
ReadonlySVG_TRANSFORM_UNKNOWN
Readonlytype
The type read-only property of the SVGTransform interface represents the type of transformation applied, specified by one of the SVG_TRANSFORM_* constants defined on this interface.
Methods
setMatrix
The
setMatrix()method of the SVGTransform interface sets the transform type toSVG_TRANSFORM_MATRIX, with parametermatrixdefining the new transformation.Parameters
Optionalmatrix: DOMMatrix2DInit
Returns void
setRotate
The
setRotate()method of the SVGTransform interface sets the transform type toSVG_TRANSFORM_ROTATE, with parameterangledefining the rotation angle and parameterscxandcydefining the optional center of rotation.Parameters
- angle: number
- cx: number
- cy: number
Returns void
setScale
The
setScale()method of the SVGTransform interface sets the transform type toSVG_TRANSFORM_SCALE, with parameterssxandsydefining the scale amounts.Parameters
- sx: number
- sy: number
Returns void
setSkewX
The
setSkewX()method of the SVGTransform interface sets the transform type toSVG_TRANSFORM_SKEWX, with parameterangledefining the amount of skew along the X-axis.Parameters
- angle: number
Returns void
setSkewY
The
setSkewY()method of the SVGTransform interface sets the transform type toSVG_TRANSFORM_SKEWY, with parameterangledefining the amount of skew along the Y-axis.Parameters
- angle: number
Returns void
setTranslate
The
setTranslate()method of the SVGTransform interface sets the transform type toSVG_TRANSFORM_TRANSLATE, with parameterstxandtydefining the translation amounts.Parameters
- tx: number
- ty: number
Returns void
The
SVGTransforminterface reflects one of the component transformations within an SVGTransformList; thus, anSVGTransformobject corresponds to a single component (e.g.,scale(…)ormatrix(…)) within a transform attribute.MDN Reference