Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Implementation of CPRectIntegral

#251

Implementation of this function. I have tested it, seems fine. But I suppose I should add some test cases to the test code.

GH: http://github.com/stevegeek/capp...

Reported by Stephen Ierodiaconou · March 13th, 2009 @ 02:38 PM

State: invalid
Milestone: 0.7
Assigned to: nobody

Activity

  1. Moritz Angermann
    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)?

    March 13th, 2009 @ 04:51 PM

  2. Stephen Ierodiaconou
    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.

    March 14th, 2009 @ 12:31 AM

  3. Ross Boucher
    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.

    March 24th, 2009 @ 10:22 PM

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.