Re: NSImage rotation regression?
Re: NSImage rotation regression?
- Subject: Re: NSImage rotation regression?
- From: Marco S Hyman <email@hidden>
- Date: Mon, 7 Sep 2009 18:33:00 -0700
On Sep 7, 2009, at 2:16 PM, Erik Buck wrote:
The -bestRepresentationFirDrevice: method is doing nothing better
than [anImage size] would do for you.
Correct in its first use, incorrect for it's second use. That
doesn't resolve the issue.
You are not doing anything useful with rotatedSize in your code.
NSImage *rotatedImage = [[NSImage alloc] initWithSize: rotatedSize];
Looks like I'm doing something with it there, no?
Your test for if (degrees == 180.0) is completely pointless. If you
were going to do it anyway, you should be looking for 90, 180, and
270 degrees as well as all other multiples of 90 deg.
Rotated size swaps X and Y for other than 180 degree rotations.
There is an assumption in the code that rotations will only be
mod 90 degrees. I left the comment out that says this in the code
posted to the list. Oops.
Why do you copy originalSize into rect?
OK, that one I can't answer other to say "because the code I copied
did that" :-) Since it worked in the 10.5 SDK I didn't much question
what was going on.
How about the following alternative code typed in Mail
I'll play with that once I understand what it is doing. Thanks.
/\/\arc
_______________________________________________
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