* Copies the values from the given {@link SVGTransform} into this
* {@link SVGTransformItem}.
*/
public void assign(SVGTransform transform) {
type = transform.getType();
SVGMatrix matrix = transform.getMatrix();
switch (type) {
case SVGTransform.SVG_TRANSFORM_TRANSLATE:
setTranslate(matrix.getE(), matrix.getF());
break;
case SVGTransform.SVG_TRANSFORM_SCALE:
setScale(matrix.getA(), matrix.getD());
break;
case SVGTransform.SVG_TRANSFORM_ROTATE:
if (matrix.getE() == 0.0f) {
rotate(transform.getAngle());
} else {
angleOnly = false;
if (matrix.getA() == 1.0f) {
setRotate(transform.getAngle(),
matrix.getE(), matrix.getF());
} else if (transform instanceof AbstractSVGTransform) {
AbstractSVGTransform internal =
(AbstractSVGTransform) transform;
setRotate(internal.getAngle(),
internal.getX(), internal.getY());