Implementation of CPRectIntegral
-
Moritz Angermann
what is the reasoning for returning a rect with a float origin on error? In particular, why return CGRectMake(0.0, 0.0, 0, 0) instead of CGRectMakeZero() or CGRectMake(0,0,0,0)?
-
Stephen Ierodiaconou
good point, the reasoning was simply that to implement it I first read the Cocoa docs
"A copy of aRect, expanded outward just enough to ensure that none of its four defining values (x, y, width, and height) have fractional parts. If the width or height of aRect is 0 or negative, this function returns a rectangle with origin at (0.0, 0.0) and with zero width and height."
and I suppose got side tracked by the float origins there, however since it doesnt matter in JS since all numbers are 64bit floating point it is pointless. I could change it to CPRectMakeZero() but then again I just noticed there is a CGRectIntegral, so maybe this commit is unnecessary.
-
Ross Boucher
- Milestone set to 0.7
- State changed from new to invalid
CGRectIntegral is what you want. If anything, we would just do CPRectIntgral=CGRectIntegral, but we'd like to fully deprecate CP stuff for graphics, which means not adding new ones.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.