How about this:
CGRect rectToConvert; NSAffineTransform *n = [NSAffineTransform transform]; [n scaleXBy:rectToConvert.size.width yBy:rectToConvert.size.height]; [n invert]; CGRect normalizedRect; normalizedRect.origin = [n transformPoint:rectToConvert.origin]; normalizedRect.size = [n transformSize: rectToConvert.size]; CGPoint anyPointINeedToConvert; CGPoint convertedPoint = [n transformPoint:anyPointINeedToConvert];
I think this makes things a little easier and allows you to take care of translations in an obvious way if you need to do them.
iluvcapra
source share