Re: NSAffineTransform scaleBy not scaling
Re: NSAffineTransform scaleBy not scaling
- Subject: Re: NSAffineTransform scaleBy not scaling
- From: Shane <email@hidden>
- Date: Tue, 1 Dec 2009 22:03:26 -0600
Still trying to make this work right using
transformUsingAffineTransform. If I add in translateXBy or scaleXBy,
my wave (pointsPath) show up all wrong, not translated or scaled, but
if I comment them out (as is below), my wave appears just fine, it's
just not scaled. Am I not using them correctly?
- (void) drawRect:(NSRect) rect
{
NSRect bounds = [self bounds];
[[NSColor blackColor] setFill];
[NSBezierPath fillRect:bounds];
//[self drawAxes];
[self drawError];
return;
}
- (void) drawError
{
float realBoundFactor = 0.9;
NSRect bounds = [self bounds];
float xFactor = (bounds.size.width * realBoundFactor) / (pointCount);
float yFactor = (bounds.size.height * realBoundFactor) / (pointCount);
NSAffineTransform *transform = [NSAffineTransform transform];
//[transform translateXBy:20.0 yBy:20.0];
//[transform scaleXBy:xFactor yBy:yFactor];
[pointsPath transformUsingAffineTransform: transform];
[[NSColor whiteColor] setStroke];
[pointsPath setLineCapStyle:NSSquareLineCapStyle];
[pointsPath stroke];
return;
}
_______________________________________________
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