• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: CGRectUnion with one empty Rectangle
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >CGRectUnion with one empty Rectangle (From: Andreas Grosam <email@hidden>)

  • Prev by Date: Re: Bindings and KVO of View objects
  • Next by Date: Re: [OT] Anyone have the a DIRECT phone number for a real person at Apple Legal???
  • Previous by thread: Re: CGRectUnion with one empty Rectangle
  • Next by thread: Re: CGRectUnion with one empty Rectangle
  • Index(es):
    • Date
    • Thread