fromLine static method

XmlElement fromLine(
  1. XmlElement lineTag
)

Converts a line element into a path element.

Implementation

static XmlElement fromLine(XmlElement lineTag) {
  final filterAttributes = [
    AttributeName.x1,
    AttributeName.x2,
    AttributeName.y1,
    AttributeName.y2,
  ];
  final x1 = _getAttribute(lineTag, AttributeName.x1);
  final y1 = _getAttribute(lineTag, AttributeName.y1);
  final x2 = _getAttribute(lineTag, AttributeName.x2);
  final y2 = _getAttribute(lineTag, AttributeName.y2);
  return _buildPath(
    'M $x1 $y1 L $x2 $y2',
    lineTag,
    filterAttributes,
  );
}