IntRect enclosingIntRect(const FloatRect& rect) { IntPoint location = flooredIntPoint(rect.minXMinYCorner()); IntPoint maxPoint = ceiledIntPoint(rect.maxXMaxYCorner()); return IntRect(location, maxPoint - location); }
IntRect enclosedIntRect(const FloatRect& rect) { IntPoint location = ceiledIntPoint(rect.minXMinYCorner()); IntPoint maxPoint = flooredIntPoint(rect.maxXMaxYCorner()); IntSize size = maxPoint - location; size.clampNegativeToZero(); return IntRect(location, size); }