Re: Affine transform not being applied to subviews
Re: Affine transform not being applied to subviews
- Subject: Re: Affine transform not being applied to subviews
- From: Graham Cox <email@hidden>
- Date: Fri, 22 May 2009 12:59:28 +1000
On 22/05/2009, at 12:52 PM, Ken Tozier wrote:
- (void) drawRect:(NSRect) inRect
{
NSAffineTransform *transform = [self transform];
[transform concat];
[[NSColor whiteColor] set];
NSRectFillUsingOperation([self frame], NSCompositeSourceOver);
[[NSColor blackColor] set];
NSFrameRectWithWidthUsingOperation([self frame], 1,
NSCompositeSourceOver);
}
Setting a transform in -drawRect: will only apply it to whatever is
drawn within that method. That doesn't include the subviews.
What are you trying to do? If you need to scale the page view then use
-scaleUnitSquareToSize: and adjust the frame. To translate use a
scrollview. To rotate, use -rotateToAngle:
--Graham
_______________________________________________
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