move method

  1. @override
void move(
  1. Vector2 offset
)
override

Translates the shape by the specified offset vector, in-place.

This method is a simpler version of project, since all shapes can be moved without changing the shape type, and with little modifications to the internal state.

Implementation

@override
void move(Vector2 offset) {
  _left += offset.x;
  _right += offset.x;
  _top += offset.y;
  _bottom += offset.y;
  _aabb?.min.add(offset);
  _aabb?.max.add(offset);
}