kCAGravityResizeAspect


#1

On page 265 I was playing around with the [boxLayer setContentsGravity:kCAGravityResizeAspect]; line to see what the different values would do in the program. When I started changing these values I did not get the results I expected. For example, kCAGravityBottomLeft placed the image in the top left section of the red box. Likewise kCAGravityTopRight placed it in the bottom right section. Why is the top/bottom location inverted?

–Dave


#2

Hi,

I don’t know why they ended up being different but in iOS, the default coordinate system origin is in the top left corner and in Mac OS X it’s the bottom left corner.

I guess these are common to both platforms and so one of them has to be “wrong”.

Gareth