• 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: NSImage rotation regression?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Re: NSImage rotation regression? (From: Erik Buck <email@hidden>)

  • Prev by Date: Re: NSImage rotation regression?
  • Next by Date: Re: Strangest UITable bug
  • Previous by thread: Re: NSImage rotation regression?
  • Next by thread: Strangest UITable bug
  • Index(es):
    • Date
    • Thread