Created
April 18, 2016 22:03
-
-
Save soffes/1b8e23314978c787bb12ea3a93c7ae10 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import CoreGraphics | |
| extension CGRect { | |
| var floor: CGRect { | |
| return CGRect( | |
| x: CoreGraphics.floor(origin.x), | |
| y: CoreGraphics.floor(origin.y), | |
| width: CoreGraphics.floor(size.width), | |
| height: CoreGraphics.floor(size.height) | |
| ) | |
| } | |
| var ceil: CGRect { | |
| return CGRect( | |
| x: CoreGraphics.ceil(origin.x), | |
| y: CoreGraphics.ceil(origin.y), | |
| width: CoreGraphics.ceil(size.width), | |
| height: CoreGraphics.ceil(size.height) | |
| ) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment