#251 ✓invalid
Stephen Ierodiaconou

Implementation of CPRectIntegral

Reported by Stephen Ierodiaconou | March 13th, 2009 @ 02:38 PM | in 0.7

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...

Comments and changes to this ticket

  • Moritz Angermann

    Moritz Angermann March 13th, 2009 @ 04:51 PM

    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

    Stephen Ierodiaconou March 14th, 2009 @ 12:31 AM

    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

    Ross Boucher March 24th, 2009 @ 10:22 PM

    • 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.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

The Cappuccino Web Framework, including AppKit, Foundation, and Objective-J.

Shared Ticket Bins

People watching this ticket