Correct fade transition when content modes differ#786
Merged
Conversation
Previously runCrossDissolveWithContentMode was adding the transitionView to the imageView and settting the imageViews alpha to 0. This resulted in the image immediately disappearing since alpha of subviews are multiplied by the alpha of parent views.
ejensen
commented
May 28, 2024
Comment on lines
+415
to
+418
| transitionView.clipsToBounds = imageView.clipsToBounds | ||
| transitionView.layer.cornerRadius = imageView.layer.cornerRadius | ||
| transitionView.layer.cornerCurve = imageView.layer.cornerCurve | ||
| transitionView.layer.maskedCorners = imageView.layer.maskedCorners |
Contributor
Author
There was a problem hiding this comment.
An alternative to trying to match any masking of imageView is to take a snapshot of the view before it is changed. This branch does that alternative method: main...ejensen:transition-fix-2
Owner
There was a problem hiding this comment.
Thanks for fixing it!
I don't have any strong preferences in terms of which approach to use. I assume the one from the PR was your primary choice, so I'm OK merging it as is.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously
runCrossDissolveWithContentModewas adding thetransitionViewas a subview of theimageViewand setttingimageView.alpha = 0. This resulted in the image immediately disappearing since thealphaof subviews is multiplied by thealphaof super views.This PR adds the
transitionViewto thesuperviewof theimageViewso the two image view's alphas are independent and properly cross-dissolve.