• 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
NSRect and NSPoint question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSRect and NSPoint question


  • Subject: NSRect and NSPoint question
  • From: Stephen Colebrook <email@hidden>
  • Date: Mon, 26 Jan 2004 09:23:20 -0500

Ok, sorry for the length of this but it's a bit of a convoluted problem.

I'm wanting to draw a long and thin rectangle in an NSImage. Easy enough. The problem is it was to be rotated a certain number of degrees. With the data I have to draw it, I can do it three ways. Draw a stroke from an NSPoint to another NSPoint and set the stroke width to what I want, create an NSRect of the right dimensions and transform it to rotate it or create four NSPoints, one for every corner, and create an NSBezierPath between then all. Not hard either way.

The problem is, I have an other NSRect (just a regular one this time - no rotation) and I have to determine if the first rectangle (no longer a simple NSRect) and the second one intersect at all or if the second one is completely within the first.

The solution to the second problem will determine which method I use to draw the first rectangle. Has anyone encountered a similar problem of determining if an NSRect is within the bounds of or intersects a polygon defined by NSPoints?

Regards,

Stephen Colebrook
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: Memory Leak with NSMutable String
  • Next by Date: Re: Memory Leak with NSMutable String
  • Previous by thread: Re: mousedown in nstextview subclass
  • Next by thread: Problems with NSIntersectsRect
  • Index(es):
    • Date
    • Thread