shiftTopRightOf method

Rect shiftTopRightOf(
  1. Rect outer
)

Returns a new rectangle that is positioned within the top-right of the outer rectangle

Implementation

Rect shiftTopRightOf(Rect outer) {
  assert(!size.isEmpty);
  assert(!outer.size.isEmpty);

  final offset = outer.topRight.translate(-size.width, 0);
  return offset & size;
}