You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ji...@apache.org on 2019/06/20 03:56:57 UTC

[incubator-weex] branch master updated: Fix animation needlayout (#2585)

This is an automated email from the ASF dual-hosted git repository.

jianhan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-weex.git


The following commit(s) were added to refs/heads/master by this push:
     new 345878f  Fix animation needlayout (#2585)
345878f is described below

commit 345878fe8f36edb051f7152df508235ad8dd2c40
Author: wqyfavor <qi...@alibaba-inc.com>
AuthorDate: Thu Jun 20 11:56:52 2019 +0800

    Fix animation needlayout (#2585)
    
    * [iOS] Fix bug that 'width' & 'height' style value cannot be retrieved from component styles dict.
    
    * [iOS] Fix bug that 'width' & 'height' style value cannot be retrieved from component styles dict.
---
 ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m b/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m
index 36b2d78..7c77455 100644
--- a/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m
+++ b/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m
@@ -25,6 +25,7 @@
 #import "WXUtility.h"
 #import "WXLength.h"
 #import "WXTransition.h"
+#import "WXComponent+Layout.h"
 
 @interface WXAnimationInfo : NSObject<NSCopying>
 
@@ -332,7 +333,16 @@ WX_EXPORT_METHOD(@selector(transition:args:callback:))
              transitionDic:(NSMutableDictionary*)transitionDic
 {
     [transition.filterStyles setObject:args[@"styles"][property] forKey:property];
-    [transition.oldFilterStyles setObject:target.styles[property] ?:@0 forKey:property];
+    
+    id oldStyleValue = target.styles[property];
+    if (oldStyleValue == nil) {
+        oldStyleValue = [target convertLayoutValueToStyleValue:property];
+    }
+    if (oldStyleValue == nil) {
+        oldStyleValue = @"0.0";
+    }
+    [transition.oldFilterStyles setObject:oldStyleValue ?:@0 forKey:property];
+    
     [target _modifyStyles:@{property:args[@"styles"][property]}];
     [transitionDic setObject:@([args[@"duration"] doubleValue]) forKey:kWXTransitionDuration];
     [transitionDic setObject:@([args[@"delay"] doubleValue]) forKey:kWXTransitionDelay];