toRect method

Rect toRect(
  1. Size size
)

Generate a Rect from this box, out of given Size (Size is what Rect is out of).

Implementation

Rect toRect(Size size)
{
  // x, y, w, h
  return new Rect(left, top, size.width - (left + right), size.height - (top + bottom) );
}