Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion NYTPhotoViewer/NYTPhotoTransitionAnimator.m
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,15 @@ - (void)performZoomingAnimationWithTransitionContext:(id <UIViewControllerContex

CGAffineTransform finalEndingViewTransform = self.endingView.transform;

CGFloat endingViewInitialTransform = CGRectGetHeight(startingViewForAnimation.frame) / CGRectGetHeight(endingViewForAnimation.frame);
CGFloat endingViewInitialTransform = 1;
switch (self.startingView.contentMode) {
case UIViewContentModeScaleAspectFill:
case UIViewContentModeScaleToFill:
endingViewInitialTransform = CGRectGetWidth(startingViewForAnimation.frame) / CGRectGetWidth(endingViewForAnimation.frame);
break;
default:
endingViewInitialTransform = CGRectGetHeight(startingViewForAnimation.frame) / CGRectGetHeight(endingViewForAnimation.frame);
}
CGPoint translatedStartingViewCenter = [[self class] centerPointForView:self.startingView
translatedToContainerView:containerView];

Expand Down