CALayer geometryFlipped如何完全表现?

时间:2015-06-19 12:56:59

标签: ios macos core-graphics core-animation cgaffinetransform

假设我有一个名为somePath的CGPathRef,我这样做:

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

但由于某种原因,我不想翻转几何 - 我想做这样的事情:

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

flipTransform如何使图层显示与以前完全相同?

:)

1 个答案:

答案 0 :(得分:0)

CGAffineTransform flipTransform = CGAffineTransformMakeScale(1, -1);