From 1091ecd8e09d1160bc8b0c61a5fe8ffa91ed1a28 Mon Sep 17 00:00:00 2001 From: Ryan Olson Date: Fri, 16 Oct 2015 08:37:27 -0700 Subject: [PATCH] Respect destination vaules in LayoutAnimation create Reviewed By: nicklockwood Differential Revision: D2544389 fb-gh-sync-id: 9e6abdbd1f500578369e5f2c3e34d7f5ef047f5e --- React/Modules/RCTUIManager.m | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/React/Modules/RCTUIManager.m b/React/Modules/RCTUIManager.m index 574eebdc4..87ae23d80 100644 --- a/React/Modules/RCTUIManager.m +++ b/React/Modules/RCTUIManager.m @@ -526,6 +526,8 @@ extern NSString *RCTBridgeModuleNameForClass(Class cls); // Animate view creation if (createAnimation) { + CATransform3D finalTransform = view.layer.transform; + CGFloat finalOpacity = view.layer.opacity; if ([createAnimation.property isEqualToString:@"scaleXY"]) { view.layer.transform = CATransform3DMakeScale(0, 0, 0); } else if ([createAnimation.property isEqualToString:@"opacity"]) { @@ -533,9 +535,9 @@ extern NSString *RCTBridgeModuleNameForClass(Class cls); } [createAnimation performAnimations:^{ if ([createAnimation.property isEqual:@"scaleXY"]) { - view.layer.transform = CATransform3DIdentity; + view.layer.transform = finalTransform; } else if ([createAnimation.property isEqual:@"opacity"]) { - view.layer.opacity = 1.0; + view.layer.opacity = finalOpacity; } else { RCTLogError(@"Unsupported layout animation createConfig property %@", createAnimation.property);