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

Commit

Permalink
* [ios] fix transition transform value incorrect
Browse files Browse the repository at this point in the history
  • Loading branch information
doumafang authored and acton393 committed Nov 23, 2017
1 parent 34b76b9 commit 8d5b79a
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions ios/sdk/WeexSDK/Sources/Module/WXTransition.m
Original file line number Diff line number Diff line change
Expand Up @@ -243,21 +243,20 @@ - (void)_dealTransitionWithProperty:(NSString *)singleProperty styles:(NSDiction
info.perValue = @([info.toValue floatValue] - [info.fromValue floatValue]);
[_propertyArray addObject:info];
}

if (wxTransform.translateX && [wxTransform.translateX floatValue] !=[oldTransform.translateX floatValue]) {
WXTransitionInfo *info = [WXTransitionInfo new];
info.propertyName = @"transform.translation.x";
info.fromValue = @([oldTransform.translateX valueForMaximum:_targetComponent.view.bounds.size.width]);
info.toValue = @([wxTransform.translateX valueForMaximum:_targetComponent.view.bounds.size.width]);
info.perValue = @([info.toValue floatValue] - [info.fromValue floatValue]);
info.fromValue = @([oldTransform.translateX floatValue]);
info.toValue = @([wxTransform.translateX floatValue]);
info.perValue = @([wxTransform.translateX floatValue] - [oldTransform.translateX floatValue]);
[_propertyArray addObject:info];
}
if (wxTransform.translateY && [wxTransform.translateY floatValue] !=[oldTransform.translateY floatValue]) {
WXTransitionInfo *info = [WXTransitionInfo new];
info.propertyName = @"transform.translation.y";
info.fromValue = @([oldTransform.translateY valueForMaximum:_targetComponent.view.bounds.size.height]);
info.toValue = @([wxTransform.translateY valueForMaximum:_targetComponent.view.bounds.size.height]);
info.perValue = @([info.toValue floatValue] - [info.fromValue floatValue]);
info.fromValue = @([oldTransform.translateY floatValue]);
info.toValue = @([wxTransform.translateY floatValue]);
info.perValue = @([wxTransform.translateY floatValue] - [oldTransform.translateY floatValue]);
[_propertyArray addObject:info];
}
_targetComponent->_transform = wxTransform;
Expand Down

0 comments on commit 8d5b79a

Please sign in to comment.