getNodeTransform method

Matrix3? getNodeTransform(
  1. XmlElement node
)

Implementation

Matrix3? getNodeTransform(XmlElement node) {
  if ((node.getAttribute('transform') == null ||
    (node.name.local == 'use' &&
    (node.getAttribute('x') == null ||
    node.getAttribute('y') == null))
  )) {
    return Matrix3.identity();
  }

  final transform = parseNodeTransform(node);

  if (transformStack.isNotEmpty) {
    transform.premultiply(transformStack[transformStack.length - 1]);
  }

  currentTransform.setFrom(transform);
  transformStack.add(transform);

  return transform;
}