• 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: NSBezierPath clipRect confusion
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSBezierPath clipRect confusion


  • Subject: Re: NSBezierPath clipRect confusion
  • From: Moray Taylor <email@hidden>
  • Date: Wed, 3 Nov 2004 22:20:52 +0000

Hi,

You are of course correct, when I look at it again, my save/restores were not being called in the correct order, so was my own dumb fault.

Thanks for the help

Moray

I'm trying to use NSBezierPath's clipRect method to help me draw within a rectangle, it works OK, but I can't seem to turn off the clipping path so I can continue drawing as normal.

I've used
[NSBezierPath clipRect:ClipRect];
to create the path, I do my drawing, this works nicely, but then I want to continue drawing outside the clipping path, which I can't figure out how to do.


I've tried wrapping the clipped drawing bit in save/restore graphics state, but no joy.

Can anyone point out a good example of how to turn the clipping path off?

The right way to do it is with the save and restore:

[NSGraphicsContext saveGraphicsState];
[NSBezierPath clipRect: clipRect];

... additional drawing here ...
[NSGraphicsContext restoreGraphicsState];

... non-clipped drawing here ...

If the save and restore are not working for you then perhaps we should see a larger snippet of your code.

Scott


_______________________________________________ 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
References: 
 >NSBezierPath clipRect confusion (From: Moray Taylor <email@hidden>)
 >Re: NSBezierPath clipRect confusion (From: "R. Scott Thompson" <email@hidden>)

  • Prev by Date: Meaning of NSFont italicAngle?
  • Next by Date: Fwd: Post for Cocoadev
  • Previous by thread: Re: NSBezierPath clipRect confusion
  • Next by thread: Meaning of NSFont italicAngle?
  • Index(es):
    • Date
    • Thread