Clip a rotated NSView
Clip a rotated NSView
- Subject: Clip a rotated NSView
- From: Leonardo <email@hidden>
- Date: Tue, 03 Dec 2013 18:31:14 +0100
- Thread-topic: Clip a rotated NSView
I draw an NSImage within a custom NSView's drawRect: method
[mImage drawInRect:imageRect...
It works well. The NSView lays on another NSView, which includes the page
area in the center and the working area, around the page. So when I draw an
image bigger than the page, I clearly see the whole image laying out of the
page. That's fine. When the user needs it, I have to display to the user the
page as it will be printed, so I need to cut off the parts of the image
laying out of the page. To achieve that, in the NSView's (with the mImage)
drawRect: method I simply add
pagePath = [NSBezierPath bezierPathWithRect:pageRect];
[pagePath addClip];
It works well when the NSView containing the mImage is not rotated. But if
the NSView is rotated, the [pagePath addClip] seems to be ignored.
How to fix that?
Regards
-- Leonardo
_______________________________________________
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