weex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acton...@apache.org
Subject [5/6] incubator-weex git commit: * [ios] fix bug about rotate order
Date Thu, 03 Aug 2017 09:51:23 GMT
* [ios] fix bug about rotate order


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/af653d98
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/af653d98
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/af653d98

Branch: refs/heads/0.16-dev
Commit: af653d98f3867dbda5ba1e34218f6d75b968accd
Parents: 6cf70bb
Author: acton393 <zhangxing610321@gmail.com>
Authored: Thu Jul 27 22:23:52 2017 +0800
Committer: acton393 <zhangxing610321@gmail.com>
Committed: Thu Jul 27 22:23:52 2017 +0800

----------------------------------------------------------------------
 ios/sdk/WeexSDK/Sources/Component/WXTransform.m | 23 ++++++++------------
 .../WeexSDK/Sources/Module/WXAnimationModule.m  |  5 -----
 2 files changed, 9 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/af653d98/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 9c055c2..5267f90 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXTransform.m
+++ b/ios/sdk/WeexSDK/Sources/Component/WXTransform.m
@@ -153,17 +153,17 @@
     }
     
     CATransform3D nativeTransform3d = [self nativeTransformWithoutRotateWithView:view];
-    if (_rotateX != 0) {
-        CATransform3D rotateXTransform = CATransform3DMakeRotation(_rotateX, 1, 0, 0);
-        nativeTransform3d = CATransform3DConcat(nativeTransform3d, rotateXTransform);
+
+    if (_rotateAngle != 0 || _rotateZ != 0) {
+        nativeTransform3d = CATransform3DRotate(nativeTransform3d, _rotateAngle?:_rotateZ,
0, 0, 1);
     }
+    
     if (_rotateY != 0) {
-        CATransform3D rotateYTransform = CATransform3DMakeRotation(_rotateY, 0, 1, 0);
-        nativeTransform3d = CATransform3DConcat(nativeTransform3d, rotateYTransform);
+        nativeTransform3d = CATransform3DRotate(nativeTransform3d, _rotateY, 0, 1, 0);
     }
-    if (_rotateAngle != 0 || _rotateZ != 0) {
-        CATransform3D rotateZTransform = CATransform3DMakeRotation(_rotateAngle?:_rotateZ,
0, 0, 1);
-        nativeTransform3d = CATransform3DConcat(nativeTransform3d, rotateZTransform);
+    
+    if (_rotateX != 0) {
+        nativeTransform3d = CATransform3DRotate(nativeTransform3d, _rotateX, 1, 0, 0);
     }
     
     return nativeTransform3d;
@@ -230,12 +230,7 @@
         [self setAnchorPoint:anchorPoint forView:view];
     }
     CATransform3D nativeTransform3d = [self nativeTransformWithView:view];
-    CATransform3D presentationTransform = view.layer.presentationLayer.transform;
-    if (!CATransform3DEqualToTransform(view.layer.transform, nativeTransform3d) &&
!CATransform3DEqualToTransform(view.layer.transform, presentationTransform)){
-        if (presentationTransform.m34 != 0 && !isinf(_perspective)) {
-            //  just for perspective
-            nativeTransform3d = presentationTransform;
-        }
+    if (!CATransform3DEqualToTransform(view.layer.transform, nativeTransform3d)){
         view.layer.transform = nativeTransform3d;
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/af653d98/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m b/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m
index 01bf984..38651e0 100644
--- a/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m
+++ b/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m
@@ -117,11 +117,6 @@
         return;
     }
     
-    float perspective = _animationInfo.target->_transform.perspective;
-    if (!isinf(perspective)) {
-        [self applyTransform];
-    }
-    
     if ([_animationInfo.propertyName hasPrefix:@"bounds.size"]) {
         /*
          * http://ronnqvi.st/about-the-anchorpoint/


Mime
View raw message