iOS: fix canot set pivot to zero

This commit is contained in:
pengfei.zhou 2021-12-28 16:30:08 +08:00 committed by osborn
parent 39e1fc98e2
commit 4aa1380a5a

View File

@ -128,8 +128,9 @@ - (void)transformProperties {
if (self.rotation) {
transform = CGAffineTransformRotate(transform, (self.rotation.floatValue ?: 0) * M_PI);
}
self.view.layer.anchorPoint = CGPointMake(self.pivotX.floatValue
?: 0.5f, self.pivotY.floatValue ?: 0.5f);
self.view.layer.anchorPoint = CGPointMake(
self.pivotX ? self.pivotX.floatValue : 0.5f,
self.pivotY ? self.pivotY.floatValue : 0.5f);
if (self.rotationX || self.rotationY) {
CATransform3D transform3D = CATransform3DMakeAffineTransform(transform);