Created
March 18, 2016 09:26
-
-
Save pyrou/5cf1faeb85df4bb36fa0 to your computer and use it in GitHub Desktop.
This file contains 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
#ifndef __CGRECT_MACROS__ | |
#define __CGRECT_MACROS__ | |
#define CGRectX(rect) rect.origin.x | |
#define CGRectY(rect) rect.origin.y | |
#define CGRectWidth(rect) rect.size.width | |
#define CGRectHeight(rect) rect.size.height | |
#define CGRectSetSize(rect, w, h) CGRectMake(CGRectX(rect), CGRectY(rect), w, h) | |
#define CGRectSetOrigin(rect, x, y) CGRectMake(x, y, CGRectWidth(rect), CGRectHeight(rect)) | |
#define CGRectSetWidth(rect, w) CGRectSetSize(rect, w, CGRectHeight(rect)) | |
#define CGRectSetHeight(rect, h) CGRectSetSize(rect, CGRectWidth(rect), h) | |
#define CGRectSetX(rect, x) CGRectSetOrigin(rect, x, CGRectY(rect)) | |
#define CGRectSetY(rect, y) CGRectSetOrigin(rect, CGRectX(rect), y) | |
#endif /* __CGRECT_MACROS__ */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment