shift method
Returns a new rectangle translated by the given offset.
To translate a rectangle by separate x and y components rather than by an
vm.Vector2
, consider translate.
Implementation
Rectangle shift(vm.Vector2 offset) {
return Rectangle.fromLTRB(
left + offset.x, top + offset.y, right + offset.x, bottom + offset.y);
}