Skip to content

Commit

Permalink
Hidden subviews not taken in account in optimized snapshot type (#521)
Browse files Browse the repository at this point in the history
* Hidden subviews not taken in account in optimized snapshot type

* Update CHANGELOG.md

* Update CHANGELOG and move to correct section
  • Loading branch information
ManueGE authored and SD10 committed Dec 27, 2018
1 parent d0a0ef8 commit 27c0fe5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ The changelog for `Hero`. Also see the [releases](https://github.com/HeroTransit

## Upcoming release

### Changed

- The hidden state of subviews are now taken into account in optimized snapshot type for `UIImageView`.
[#521](https://github.com/HeroTransitions/Hero/pull/521) by [@ManueGE](https://github.com/ManueGE)

## [1.4.0](https://github.com/HeroTransitions/Hero/releases/tag/1.4.0)

### Added
Expand Down
2 changes: 1 addition & 1 deletion Sources/HeroContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ extension HeroContext {
#else
if #available(iOS 9.0, *), let stackView = view as? UIStackView {
snapshot = stackView.slowSnapshotView()
} else if let imageView = view as? UIImageView, view.subviews.isEmpty {
} else if let imageView = view as? UIImageView, view.subviews.filter({!$0.isHidden}).isEmpty {
let contentView = UIImageView(image: imageView.image)
contentView.frame = imageView.bounds
contentView.contentMode = imageView.contentMode
Expand Down

0 comments on commit 27c0fe5

Please sign in to comment.