You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ac...@apache.org on 2017/06/09 06:22:25 UTC

[04/12] incubator-weex git commit: * [ios] use pixel type

* [ios] use pixel type


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

Branch: refs/heads/0.14-dev
Commit: a6c508e9b8aff13077ca76394e372cfa823ee951
Parents: 75008cc
Author: acton393 <zh...@gmail.com>
Authored: Tue Jun 6 15:14:23 2017 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Tue Jun 6 15:14:23 2017 +0800

----------------------------------------------------------------------
 ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m        | 2 ++
 ios/sdk/WeexSDK/Sources/View/WXComponent+ViewManagement.m | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/a6c508e9/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 76a9d6a..b7d550c 100644
--- a/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m
+++ b/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m
@@ -91,6 +91,8 @@
     
     if ([_animationInfo.propertyName hasPrefix:@"transform"]) {
         WXTransform *transform = _animationInfo.target->_transform;
+        float perspective = [[_animationInfo.target valueForKey:@"perspective"] floatValue];
+        transform.perspective = perspective;
         [transform applyTransformForView:_animationInfo.target.view];
     } else if ([_animationInfo.propertyName isEqualToString:@"backgroundColor"]) {
         _animationInfo.target.view.layer.backgroundColor = (__bridge CGColorRef _Nullable)(_animationInfo.toValue);

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/a6c508e9/ios/sdk/WeexSDK/Sources/View/WXComponent+ViewManagement.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/View/WXComponent+ViewManagement.m b/ios/sdk/WeexSDK/Sources/View/WXComponent+ViewManagement.m
index 57428ce..668f9ad 100644
--- a/ios/sdk/WeexSDK/Sources/View/WXComponent+ViewManagement.m
+++ b/ios/sdk/WeexSDK/Sources/View/WXComponent+ViewManagement.m
@@ -169,7 +169,7 @@ do {\
         _lastBoxShadow = _boxShadow;
     }
     if (styles[@"perspective"]) {
-        _perspective = [WXConvert CGFloat:styles[@"perspective"]];
+        _perspective = [WXConvert WXPixelType:styles[@"perspective"] scaleFactor:self.weexInstance.pixelScaleFactor];
         _transform.perspective = _perspective;
     }
 }
@@ -240,7 +240,7 @@ do {\
         }
     }
     if (styles[@"perspective"]) {
-        _perspective = [WXConvert CGFloat:styles[@"perspective"]];
+        _perspective = [WXConvert WXPixelType:styles[@"perspective"] scaleFactor:self.weexInstance.pixelScaleFactor];
     }
     if (styles[@"transform"]) {
         _transform = [[WXTransform alloc] initWithCSSValue:[WXConvert NSString:styles[@"transform"]] origin:[WXConvert NSString:self.styles[@"transformOrigin"]] instance:self.weexInstance];