parseLineNode method

ShapePath parseLineNode(
  1. XmlElement node
)

Implementation

ShapePath parseLineNode(XmlElement node) {
  final x1 = parseFloatWithUnits(node.getAttribute('x1'));
  final y1 = parseFloatWithUnits(node.getAttribute('y1'));
  final x2 = parseFloatWithUnits(node.getAttribute('x2'));
  final y2 = parseFloatWithUnits(node.getAttribute('y2'));

  final path = ShapePath();
  path.moveTo(x1, y1);
  path.lineTo(x2, y2);
  path.currentPath.autoClose = false;

  return path;
}