Skip to content

Instantly share code, notes, and snippets.

@harlanhaskins
Created April 3, 2021 20:52
Show Gist options
  • 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