rightCenterRect function

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

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

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

Implementation

Rectangle rightCenterRect(Rectangle area, int width, int height) {
  final centerY = area.minY + area.height ~/ 2;
  final minY = centerY - height ~/ 2;
  return rect(area.maxX - width, minY, width, height).intersect(area);
}