getPositions method

List<GPoint> getPositions([
  1. List<GPoint>? out
])

Returns a list of four GPoint instances representing the positions of the top-left, top-right, bottom-right, and bottom-left corners of this GRect.

If an out list is provided, it will be used to store the four corner positions and returned. Otherwise, a new list will be generated.

Implementation

List<GPoint> getPositions([List<GPoint>? out]) {
  out ??= List.generate(4, (i) => GPoint());
  out[2].x = out[0].x = left;
  out[1].y = out[0].y = top;
  out[3].x = out[1].x = right;
  out[3].y = out[2].y = bottom;
  return out;
}