diff --git a/CHANGELOG.md b/CHANGELOG.md index ce99c146575..b960963766b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## Unreleased + +### Fixes + +- Proper redact SR during animation (#4289) + ## 8.34.0 ### Features diff --git a/Sources/Swift/Tools/UIRedactBuilder.swift b/Sources/Swift/Tools/UIRedactBuilder.swift index e74ff98e708..8b1d8d8a852 100644 --- a/Sources/Swift/Tools/UIRedactBuilder.swift +++ b/Sources/Swift/Tools/UIRedactBuilder.swift @@ -111,7 +111,7 @@ class UIRedactBuilder { var redactingRegions = [RedactRegion]() self.mapRedactRegion(fromView: view, - to: view, + to: view.layer.presentation() ?? view.layer, redacting: &redactingRegions, area: view.frame, redactText: options?.redactAllText ?? true, @@ -141,8 +141,8 @@ class UIRedactBuilder { return image.imageAsset?.value(forKey: "_containingBundle") == nil } - private func mapRedactRegion(fromView view: UIView, to: UIView, redacting: inout [RedactRegion], area: CGRect, redactText: Bool, redactImage: Bool) { - let rectInWindow = view.convert(view.bounds, to: to) + private func mapRedactRegion(fromView view: UIView, to: CALayer, redacting: inout [RedactRegion], area: CGRect, redactText: Bool, redactImage: Bool) { + let rectInWindow = (view.layer.presentation() ?? view.layer).convert(view.bounds, to: to) guard (redactImage || redactText) && area.intersects(rectInWindow) && !view.isHidden && view.alpha != 0 else { return } let ignore = shouldIgnore(view: view)