parseLineNode method

ShapePath parseLineNode(
  1. dynamic node
)

Implementation

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

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

  return path;
}