-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zoomRelativePoint: Can Lead to NaN Values #37
Comments
So I'm thinking that returning |
|
👍 |
I think CGPointZero would be incorrect, it's the geometric zero. If you cannot do the math because you don't have a size you should probably explicitly fail. Raise an error? |
Yeah unfortunately there's no equivalent of |
Maybe just assert and return the original point otherwise? |
Not sure if I like that, though. I mean, that'd bring down the whole app just for the |
Agreed on overkill. Do you think adding an assert and not changing anything in the code itself would be sufficient? A store app will run through the assert and do what the current version of the library is doing (NaN). |
Yeah I think you're right @dblock – probably the best compromise. |
Consider the following code:
If
originalSize
hasn't been set fromCGPointZero
, then the resultingx
andy
values can beNaN
, so if you rely on the return value for this for some view geometry, it can lead to an app crash.The text was updated successfully, but these errors were encountered: