agens-no / AGGeometryKit

Quadrilaterals on CALayer, CGGeometry-functions, UIView/CALayer properties and other invaluable tools.
Other
1.27k stars 130 forks source link

Fix edge cases calculation often causing float overflows. #33

Closed gavrix closed 8 years ago

gavrix commented 8 years ago

I noticed when trying to correct perspective transform from 4 arbitrary points, this routine often returns NaN thus destroying all further geometry calculations. With the correction proposed I was able to make it work ideally on all cases for me. This may also fix issue people refer to here

hfossli commented 8 years ago

@snown can you do a code review?

snown commented 8 years ago

I will take a look

hfossli commented 8 years ago

I'll be merging this very soon and publish to cocoapods.

snown commented 8 years ago

Work has been extremely busy lately, but I am hopeful that I will have time to take a look in the next 24 hours. Sorry for the delay.

snown commented 8 years ago

This looks good. It's a pretty simple change, but it's smart.

hfossli commented 8 years ago

Thanks for doing the code review. I'll publish this version tomorrow.

hfossli commented 8 years ago

Published as version 1.2.3. Suitable tag version for this cute fix. Thanks @gavrix

gavrix commented 8 years ago

Thanks you guys. Glad to help!