sizeToVertices static method

  1. @protected
List<Vector2> sizeToVertices(
  1. Vector2 size,
  2. Anchor? componentAnchor
)

Implementation

@protected
static List<Vector2> sizeToVertices(
  Vector2 size,
  Anchor? componentAnchor,
) {
  final anchor = componentAnchor ?? Anchor.topLeft;
  return [
    Vector2(-size.x * anchor.x, -size.y * anchor.y),
    Vector2(-size.x * anchor.x, size.y - size.y * anchor.y),
    Vector2(size.x - size.x * anchor.x, size.y - size.y * anchor.y),
    Vector2(size.x - size.x * anchor.x, -size.y * anchor.y),
  ];
}