bottomRightRect function

Rectangle bottomRightRect(
  1. Rectangle area,
  2. int width,
  3. int height
)

Returns a new Rectangle at the bottom-right of area with width and height.

Upstream: BottomRightRect in third_party/ultraviolet/layout.go.

Implementation

Rectangle bottomRightRect(Rectangle area, int width, int height) {
  return rect(
    area.maxX - width,
    area.maxY - height,
    width,
    height,
  ).intersect(area);
}