Skip to content

Instantly share code, notes, and snippets.

@alinradut
Created May 26, 2011 08:40
Show Gist options
  • Save alinradut/992787 to your computer and use it in GitHub Desktop.
Save alinradut/992787 to your computer and use it in GitHub Desktop.
Useful CGRect manipulation defines
#define CGRectSetPos( r, x, y ) CGRectMake( x, y, r.size.width, r.size.height )
#define CGRectSetX( r, x ) CGRectMake( x, r.origin.y, r.size.width, r.size.height )
#define CGRectSetY( r, y ) CGRectMake( r.origin.x, y, r.size.width, r.size.height )
#define CGRectSetSize( r, w, h ) CGRectMake( r.origin.x, r.origin.y, w, h )
#define CGRectSetWidth( r, w ) CGRectMake( r.origin.x, r.origin.y, w, r.size.height )
#define CGRectSetHeight( r, h ) CGRectMake( r.origin.x, r.origin.y, r.size.width, h )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment