【问题标题】:How does CALayer geometryFlipped behave exactly?CALayer geometryFlipped 的行为如何?
【发布时间】:2015-06-19 12:56:58
【问题描述】:

假设我有一个名为 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 必须看起来如何才能使图层显示与以前完全相同?

:)

【问题讨论】:

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


    【解决方案1】:

    CGAffineTransform flipTransform = CGAffineTransformMakeScale(1, -1);

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-03-30
      • 2019-04-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多