| 78 | const AffineTransform AffineTransform::IDENTITY = AffineTransformMakeIdentity(); |
| 79 | |
| 80 | Rect RectApplyAffineTransform(const Rect& rect, const AffineTransform& anAffineTransform) |
| 81 | { |
| 82 | float top = rect.getMinY(); |
| 83 | float left = rect.getMinX(); |
| 84 | float right = rect.getMaxX(); |
| 85 | float bottom = rect.getMaxY(); |
| 86 | |
| 87 | Vec2 topLeft = PointApplyAffineTransform(Vec2(left, top), anAffineTransform); |
| 88 | Vec2 topRight = PointApplyAffineTransform(Vec2(right, top), anAffineTransform); |
| 89 | Vec2 bottomLeft = PointApplyAffineTransform(Vec2(left, bottom), anAffineTransform); |
| 90 | Vec2 bottomRight = PointApplyAffineTransform(Vec2(right, bottom), anAffineTransform); |
| 91 | |
| 92 | float minX = min(min(topLeft.x, topRight.x), min(bottomLeft.x, bottomRight.x)); |
| 93 | float maxX = max(max(topLeft.x, topRight.x), max(bottomLeft.x, bottomRight.x)); |
| 94 | float minY = min(min(topLeft.y, topRight.y), min(bottomLeft.y, bottomRight.y)); |
| 95 | float maxY = max(max(topLeft.y, topRight.y), max(bottomLeft.y, bottomRight.y)); |
| 96 | |
| 97 | return Rect(minX, minY, (maxX - minX), (maxY - minY)); |
| 98 | } |
| 99 | |
| 100 | Rect RectApplyTransform(const Rect& rect, const Mat4& transform) |
| 101 | { |
no test coverage detected