Skip to content

Instantly share code, notes, and snippets.

@harlanhaskins
Created April 3, 2021 20:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save harlanhaskins/84e4d6bcac63fac0bbfab59c321e5ded to your computer and use it in GitHub Desktop.
Save harlanhaskins/84e4d6bcac63fac0bbfab59c321e5ded to your computer and use it in GitHub Desktop.
Project a UnitPoint to a CGRect
extension CGRect {
func projecting(_ point: UnitPoint) -> CGPoint {
return CGPoint(x: minX + (width * point.x),
y: minY + (height * point.y))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment