Skip to content

Commit

Permalink
[Shared Element Transition] Restore X-axis origin (software-mansion#4086
Browse files Browse the repository at this point in the history
)

## Summary

Restore the X-axis origin after the shared animation. Previously I was
restoring only Y origin to handle the screen with a header, but X origin
restoring is required when the screen has its transition animation.
  • Loading branch information
piaskowyk authored Feb 23, 2023
1 parent 11a0ba8 commit 4d3b1af
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ios/LayoutReanimation/REASharedTransitionManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -557,8 +557,9 @@ - (void)finishSharedAnimation:(UIView *)view
[_animationManager progressLayoutAnimationWithStyle:viewSourcePreviousSnapshot.values
forTag:viewTag
isSharedTransition:YES];
float originXByParent = [viewSourcePreviousSnapshot.values[@"originXByParent"] floatValue];
float originYByParent = [viewSourcePreviousSnapshot.values[@"originYByParent"] floatValue];
CGRect frame = CGRectMake(view.frame.origin.x, originYByParent, view.frame.size.width, view.frame.size.height);
CGRect frame = CGRectMake(originXByParent, originYByParent, view.frame.size.width, view.frame.size.height);
[view setFrame:frame];
}
if ([_viewsToHide containsObject:viewTag]) {
Expand Down

0 comments on commit 4d3b1af

Please sign in to comment.