Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CALayer frame origin.y is flipped, 0 is at the bottom?

When I Add a set the fram on a CALayer the origin.y is reversed, 0 is at the bottom of it super layer and increasing origin.y moves it up in its super layer. Is there something I did to cause this to be flipped? I would expect origin.y=0 to be the top, not the bottom.

Thanks,

like image 527
Justin808 Avatar asked Mar 03 '11 04:03

Justin808


1 Answers

You can flip the coordinate system to behave like iOS like this...

layer.sublayerTransform = CATransform3DMakeScale(1.0f, -1.0f, 1.0f);
like image 174
Mark Adams Avatar answered Nov 02 '22 08:11

Mark Adams