bottomCenterRect function

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

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

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

Implementation

Rectangle bottomCenterRect(Rectangle area, int width, int height) {
  final centerX = area.minX + area.width ~/ 2;
  final minX = centerX - width ~/ 2;
  return rect(minX, area.maxY - height, width, height).intersect(area);
}