Use union of bounding rectangles when calculating input size.