How does CALayer geometryFlipped behave exactly?

584 views Asked by At

Let's assume i have a CGPathRef called somePath and I'm doing this:

CAShapeLayer *shapeLayer = [[CAShapeLayer alloc] init];
shapeLayer.path = somePath;
shapeLayer.geometryFlipped = YES;

But for some reason i don't want to flip the geometry – i'd want to do something like this:

CAShapeLayer *shapeLayer = [[CAShapeLayer alloc] init];
CGAffineTransform flipTransform = ........;
shapeLayer.path = CGPathApplyAffineTransform(somePath, &flipTransform);
shapeLayer.geometryFlipped = NO;

How would the flipTransform have to look like to make the layer display exactly the same as before?

:)

1

There are 1 answers

0
Blind Ninja On BEST ANSWER

CGAffineTransform flipTransform = CGAffineTransformMakeScale(1, -1);