You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by gu...@apache.org on 2017/10/02 02:53:53 UTC

[06/20] incubator-weex git commit: * [ios] fix perspective bug

* [ios] fix perspective bug


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

Branch: refs/heads/master
Commit: cfdaa679a4123858325ad25a0efa473903aff134
Parents: 05053f0
Author: acton393 <zh...@gmail.com>
Authored: Fri Sep 29 16:18:38 2017 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Fri Sep 29 16:18:38 2017 +0800

----------------------------------------------------------------------
 ios/sdk/WeexSDK/Sources/Component/WXTransform.m | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/cfdaa679/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 4bf202f..9e5c362 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXTransform.m
+++ b/ios/sdk/WeexSDK/Sources/Component/WXTransform.m
@@ -22,6 +22,7 @@
 #import "WXLength.h"
 #import "WXUtility.h"
 #import "WXSDKInstance.h"
+#import "WXConvert.h"
 
 @interface WXTransform()
 
@@ -174,7 +175,7 @@
     CATransform3D nativeTansform3D = CATransform3DIdentity;
     
     if (_perspective && !isinf(_perspective)) {
-        nativeTansform3D.m34 = -1.0/_perspective*[UIScreen mainScreen].scale;
+        nativeTansform3D.m34 = -1.0/_perspective;
     }
     if (!view || view.bounds.size.width <= 0 || view.bounds.size.height <= 0) {
         return nativeTansform3D;
@@ -339,7 +340,7 @@
 
 - (void)parsePerspective:(NSArray *)value
 {
-    _perspective = [value[0] doubleValue];
+    _perspective = [WXConvert WXPixelType:value[0] scaleFactor:self.weexInstance.pixelScaleFactor];
     if (_perspective <= 0 ) {
         _perspective = CGFLOAT_MAX;
     }