• 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
NSBezierPath bugs? (Contains point and fill)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSBezierPath bugs? (Contains point and fill)


  • Subject: NSBezierPath bugs? (Contains point and fill)
  • From: Scott Harper <email@hidden>
  • Date: Wed, 12 Oct 2005 01:33:33 -0600

Hello,

I have a drawing app that uses 'NSBezierPath's for selection outlines, which works really well for rectangles. I grab all the pixels inside the path into the selection buffer, then paint everything inside the path (on the original image) white, or whatever other background color. I run into two problems, however, when using non-rectangular paths -- ie free drawn paths which are then closed after the mouse is released.

First, when I iterate through all the points in the rect gotten from the path's -bounds method and check them to see if the pixel is within the path -- [path containsPoint:NSMakePoint(x, y)] -- I will sometimes get several pixels WITHIN the path that do not register as BEING contained by that path. It's generally several points inside horizontally, and it often occurs a couple of times along a given edge. It never happens with columns of pixels, either. I don't know what could be causing this, though I'm pretty sure it's not MY fault. Any advice on this one? Is it a known issue, and are there perhaps workarounds known?

Second, I have my image set to have NO alpha blending at all, so drawing lines results in SOLID colors without and smoothing. Yet again, when I use a non-rectangular NSBezierPath and fill its contents to the background color, I will get some amount of grey pixels around the edges. Sometimes it is more severe, others it is less, but I'm hoping for some amount of pixel accuracy here. Again, is this a known issue with workarounds? Are there any suggestions on how to handle it?

Thanks,
--Scott Harper
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSBezierPath bugs? (Contains point and fill)
      • From: Andy Armstrong <email@hidden>
  • Prev by Date: accessing the CFSteam that NSURLConnection is using?
  • Next by Date: Re: Am I using NSConditionLock correctly?
  • Previous by thread: Re: accessing the CFSteam that NSURLConnection is using?
  • Next by thread: Re: NSBezierPath bugs? (Contains point and fill)
  • Index(es):
    • Date
    • Thread