Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
Fix animation needlayout (#2585)
Browse files Browse the repository at this point in the history
* [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.
  • Loading branch information
wqyfavor authored and jianhan-he committed Jun 20, 2019
1 parent ec44cd4 commit 345878f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#import "WXUtility.h"
#import "WXLength.h"
#import "WXTransition.h"
#import "WXComponent+Layout.h"

@interface WXAnimationInfo : NSObject<NSCopying>

Expand Down Expand Up @@ -332,7 +333,16 @@ - (void)transitionWithArgs:(NSDictionary *)args withProperty:(NSString *)propert
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];
Expand Down

0 comments on commit 345878f

Please sign in to comment.