Last active
February 3, 2016 15:35
-
-
Save zrxq/5363610 to your computer and use it in GitHub Desktop.
CGRect inset with UIEdgeInsets
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
inline static CGRect CGRectEdgeInset(CGRect rect, UIEdgeInsets insets) { | |
return CGRectMake(CGRectGetMinX(rect)+insets.left, CGRectGetMinY(rect)+insets.top, CGRectGetWidth(rect)-insets.left-insets.right, CGRectGetHeight(rect)-insets.top-insets.bottom); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
UIEdgeInsetsInsetRect does the same