Re: CGRectUnion with one empty Rectangle

2009-05-20 Thread Michael Ash
On Wed, May 20, 2009 at 5:45 PM, Shawn Erickson wrote: > On Wed, May 20, 2009 at 1:00 PM, John Harper wrote: >> CGRectZero is the rectangle at point (0, 0) with zero size. For an empty >> rectangle that will work correctly with CGRectUnion you need to use >> CGRectNull instead. > > I guess the do

Re: CGRectUnion with one empty Rectangle

2009-05-20 Thread Shawn Erickson
On Wed, May 20, 2009 at 1:00 PM, John Harper wrote: > CGRectZero is the rectangle at point (0, 0) with zero size. For an empty > rectangle that will work correctly with CGRectUnion you need to use > CGRectNull instead. I guess the docs need to be corrected then since the following implies CGRectZ

Re: CGRectUnion with one empty Rectangle

2009-05-20 Thread John Harper
CGRectZero is the rectangle at point (0, 0) with zero size. For an empty rectangle that will work correctly with CGRectUnion you need to use CGRectNull instead. John On May 20, 2009, at 11:45 AM, Gordon Apple wrote: IMHO, if it works the way you describe, it's doing the right thing

Re: CGRectUnion with one empty Rectangle

2009-05-20 Thread Gordon Apple
IMHO, if it works the way you describe, it's doing the right thing, at least mathematically speaking from a point-set viewpoint. Unfortunately, NSUnionRect works like the docs describe, which is not what I needed, so I wrote my own. It's too bad NSUnionRect and CGRectUnion appear to not be consis

Re: CGRectUnion with one empty Rectangle

2009-05-20 Thread Shawn Erickson
On Wed, May 20, 2009 at 8:31 AM, Andreas Grosam wrote: > I just stumbled over this issue with CGRectUnion when one operand is an > empty rect, or has negative width or hight: > >    CGRect r1 = CGRectZero; >    CGRect r2 = CGRectMake(100.0, 100.0, 300.0, 300.0); >    CGRect r3 = CGRectUnion(r1, r2

Re: CGRectUnion with one empty Rectangle

2009-05-20 Thread I. Savant
On Wed, May 20, 2009 at 11:31 AM, Andreas Grosam wrote: > I'm wondering if this is intended behavior and the docs are wrong, or vice > versa. I don't have an answer for your question, but the best way to get some kind of action is to file a bug report against the API at: http://bugreport.appl