globalVertices method

List<Vector2> globalVertices()

gives back the shape vectors multiplied by the size and scale

Implementation

List<Vector2> globalVertices() {
  final hasMoved = _absoluteTransform.update(this);
  if (hasMoved || !_hasValidGlobalVertices) {
    for (var i = 0; i < _vertices.length; i++) {
      _absoluteTransform.apply(_vertices[i], output: _globalVertices[i]);
    }
    if (_absoluteTransform.isMirrored) {
      // Since the list will be clockwise we have to reverse it for it to
      // become counterclockwise.
      _reverseList(_globalVertices);
    }
    _hasValidGlobalVertices = true;
  }
  return _globalVertices;
}