Repository: incubator-weex Updated Branches: refs/heads/0.15-dev bda0f674a -> 532d87ba1
* [ios] bugfix when roate3d concat Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/532d87ba Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/532d87ba Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/532d87ba Branch: refs/heads/0.15-dev Commit: 532d87ba1e4da77a82c9f8fc1c101fda319f39df Parents: bda0f67 Author: acton393 <zhangxing610...@gmail.com> Authored: Tue Jul 4 18:10:02 2017 +0800 Committer: acton393 <zhangxing610...@gmail.com> Committed: Tue Jul 4 18:10:02 2017 +0800 ---------------------------------------------------------------------- ios/sdk/WeexSDK/Sources/Component/WXTransform.m | 24 +++++++------------- 1 file changed, 8 insertions(+), 16 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/532d87ba/ios/sdk/WeexSDK/Sources/Component/WXTransform.m ---------------------------------------------------------------------- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXTransform.m b/ios/sdk/WeexSDK/Sources/Component/WXTransform.m index d4926a6..3382936 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXTransform.m +++ b/ios/sdk/WeexSDK/Sources/Component/WXTransform.m @@ -149,27 +149,19 @@ } CATransform3D nativeTransform3d = [self nativeTransformWithoutRotateWithView:view]; - float x = 0,y = 0,z = 0; - float rotateAngle = 0; - if (_rotateZ != 0) { - z = 1; - rotateAngle = _rotateZ; - } - if (_rotateAngle != 0) { - rotateAngle = _rotateAngle; - z = 1; + if (_rotateAngle != 0 || _rotateX != 0) { + CATransform3D rotateXTransform = CATransform3DMakeRotation(_rotateAngle?:_rotateX, 1, 0, 0); + nativeTransform3d = CATransform3DConcat(nativeTransform3d, rotateXTransform); } if (_rotateY != 0) { - y = 1; - rotateAngle = _rotateY; + CATransform3D rotateYTransform = CATransform3DMakeRotation(_rotateY, 0, 1, 0); + nativeTransform3d = CATransform3DConcat(nativeTransform3d, rotateYTransform); } - if (_rotateX != 0) { - x = 1; - rotateAngle = _rotateX; + if (_rotateZ != 0) { + CATransform3D rotateZTransform = CATransform3DMakeRotation(_rotateZ, 0, 0, 1); + nativeTransform3d = CATransform3DConcat(nativeTransform3d, rotateZTransform); } - nativeTransform3d = CATransform3DRotate(nativeTransform3d, rotateAngle, x, y, z); - return nativeTransform3d; }