• 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: NSAffineTransform scaleBy not scaling
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: NSAffineTransform scaleBy not scaling
      • From: Graham Cox <email@hidden>
  • Prev by Date: View sizing issue when using "disclosure view"
  • Next by Date: Re: NSAffineTransform scaleBy not scaling
  • Previous by thread: Re: View sizing issue when using "disclosure view"
  • Next by thread: Re: NSAffineTransform scaleBy not scaling
  • Index(es):
    • Date
    • Thread