• 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: How remove a clip path? SOLVED
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How remove a clip path? SOLVED


  • Subject: Re: How remove a clip path? SOLVED
  • From: Steve Christensen <email@hidden>
  • Date: Tue, 05 May 2009 13:12:18 -0700

On May 5, 2009, at 11:57 AM, McLaughlin, Michael P. wrote:

Naturally, I came up with a solution two minutes after posting my query to
this list :-(


My solution is

[[NSBezierPath bezierPathWithRect:rect] setClip];

where rect is the viewRect. This works for me. It might not be the best
solution in all cases.


*** Original post ***

In a custom NSBezierView, I fill the view with a background color then set a
clip path that will eventually be drawn as a map. I do this so that I can
color-code the map (in a complicated way) without "going outside the lines".


If I then draw the map, external boundaries are drawn as half-width lines
because the clip path divides them in half lengthwise.


I cannot just double the line width because there are internal map
boundaries as well so I would like to *remove* the clip path totally.

If I write

[[NSBezierPath new] setClip];

this works perfectly except that I get an error in the Console window which
I would rather avoid.


Is there a recommended way to remove a clip path?

Note: Setting the clip path to a dummy path outside the view does not work
because then the map will not be drawn at all.

Does something like this not work?

[NSGraphicsContext saveGraphicsState];
[[NSBezierPath bezierPathWithRect:rect] setClip];
[NSGraphicsContext restoreGraphicsState];

_______________________________________________

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: 
 >How remove a clip path? SOLVED (From: "McLaughlin, Michael P." <email@hidden>)

  • Prev by Date: Re: High Scores local to iPhone app
  • Next by Date: Re: High Scores local to iPhone app
  • Previous by thread: How remove a clip path? SOLVED
  • Next by thread: Re: How remove a clip path? SOLVED
  • Index(es):
    • Date
    • Thread