Branch: refs/heads/main Home: https://github.com/WebKit/WebKit Commit: 9e0bae9552cc178945e9187e52a742c052056305 https://github.com/WebKit/WebKit/commit/9e0bae9552cc178945e9187e52a742c052056305 Author: Abrar Rahman Protyasha <a_protya...@apple.com> Date: 2024-07-09 (Tue, 09 Jul 2024)
Changed paths: M Source/WebKit/UIProcess/ios/WKContentViewInteraction.h M Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm Log Message: ----------- QuickLook Image dismissal animation lands in the wrong place https://bugs.webkit.org/show_bug.cgi?id=276401 rdar://129983325 Reviewed by Wenson Hsieh. After the changes in (presumably) rdar://125669602, UIKit has started calling into the QLPreviewControllerDelegate method `previewController:transitionImageForPreviewItem:contentRect:` twice during one dismissal animation. Since we transform our image bounds from content view coordinates to window coordinates through `convertRect:toView:`, the second delegate call returns the wrong content rect, since by then we are in the middle of an animation and our coordinate system has changed. This leads to the image dismissal animation to end in the wrong place. To work around this issue, we can compute this image bound only once per presentation. We cache the image bound (in window coordinates) on the first call to `previewController:transitionImageForPreviewItem:contentRect:`, and we keep reusing it until the preview controller is dismissed, at which point we let go of this cached value. * Source/WebKit/UIProcess/ios/WKContentViewInteraction.h: * Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView previewController:transitionImageForPreviewItem:contentRect:]): (-[WKContentView previewControllerDidDismiss:]): Canonical link: https://commits.webkit.org/280803@main To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications _______________________________________________ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes