Re: Cocoa-dev Digest, Vol 3, Issue 798
Re: Cocoa-dev Digest, Vol 3, Issue 798
- Subject: Re: Cocoa-dev Digest, Vol 3, Issue 798
- From: David Phillip Oster <email@hidden>
- Date: Mon, 19 Jun 2006 23:52:17 -0700
At 10:21 PM -0700 6/19/06, email@hidden wrote:
Is there anything wrong in my code or analysis?
Yes
Is it a bug in NSAffineTransform?
No.
Assume the current graphic context is at the identity matrix. Assume
that after
NSAffineTransform* xform = [NSAffineTransform transform];
xform is at the identity matrix also.
[xform translateXBy:10.0 yBy:10.0];
[xform concat];
Now, both are at (10, 10).
[xform translateXBy:5.0 yBy:0.0];
You've moved xform an additional 5, so it is at (15, 10).
[xform concat]
You've moved the current graphic context by xform, so the current
graphic context goes from
(10, 10) to (25, 20).
If you had wanted to current graphic context to be at (15, 10), you
should have done:
[xform set]; instead of [xform concat];
--
David Phillip Oster
_______________________________________________
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