Re: CGRectUnion with one empty Rectangle
Re: CGRectUnion with one empty Rectangle
- Subject: Re: CGRectUnion with one empty Rectangle
- From: Shawn Erickson <email@hidden>
- Date: Wed, 20 May 2009 10:08:48 -0700
On Wed, May 20, 2009 at 8:31 AM, Andreas Grosam <email@hidden> 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);
>
> the result for r3 is actually :
> r3.origin: (0, 0)
> r3.size: (300, 300)
Try swapping r1 and r2 in CGRectUnion.... CGRectUnion(r2,r1) to see
what happens.
Anyway I recall seeing this issue at some point but I see code of mine
that can have a zero rect that doesn't appear to exhibit a problem
(but I need to retest things to be sure).
..but yeah file a defect about it.
-Shawn
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden