Skip to content

Instantly share code, notes, and snippets.

@joelrfcosta
Last active December 17, 2015 05:39
Show Gist options
  • Save joelrfcosta/5559368 to your computer and use it in GitHub Desktop.
Save joelrfcosta/5559368 to your computer and use it in GitHub Desktop.
Normalise CGRect The value will be between 0 and 1
CGAffineTransform t = CGAffineTransformMakeScale(1.0f / parentRect.size.width, 1.0f / parentRect.size.height);
CGRect unitRect = CGRectApplyAffineTransform(rect, t);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment