From d5a4f1625a626fc8c8c30a30b6a44d171453cba7 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Fri, 1 May 2020 16:24:29 -0500 Subject: [PATCH 1/2] Take device pixel ratio into consideration when drawing the image to zoom. Issue #2032 --- iOS/Resources/main_ios.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iOS/Resources/main_ios.js b/iOS/Resources/main_ios.js index 329225e0b..f3cbd712f 100644 --- a/iOS/Resources/main_ios.js +++ b/iOS/Resources/main_ios.js @@ -35,8 +35,8 @@ class ImageViewer { this.hideLoadingIndicator(); var canvas = document.createElement("canvas"); - canvas.width = this.img.naturalWidth; - canvas.height = this.img.naturalHeight; + canvas.width = this.img.naturalWidth * window.devicePixelRatio; + canvas.height = this.img.naturalHeight * window.devicePixelRatio; canvas.getContext("2d").drawImage(this.img, 0, 0, canvas.width, canvas.height); const rect = this.img.getBoundingClientRect(); From e2267d14ee44710f21e06ab09773721b015813b0 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Fri, 1 May 2020 16:34:19 -0500 Subject: [PATCH 2/2] Hold a reference to the pointer interaction to try to get it to stop crashing. Issue #2034 --- iOS/MasterFeed/Cell/MasterFeedTableViewSectionHeader.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/iOS/MasterFeed/Cell/MasterFeedTableViewSectionHeader.swift b/iOS/MasterFeed/Cell/MasterFeedTableViewSectionHeader.swift index 9c081688c..d06a33399 100644 --- a/iOS/MasterFeed/Cell/MasterFeedTableViewSectionHeader.swift +++ b/iOS/MasterFeed/Cell/MasterFeedTableViewSectionHeader.swift @@ -72,13 +72,17 @@ class MasterFeedTableViewSectionHeader: UITableViewHeaderFooterView { }() private let unreadCountView = MasterFeedUnreadCountView(frame: CGRect.zero) + + @available(iOS 13.4, *) + private(set) lazy var disclosurePointerInteraction = UIPointerInteraction() + private lazy var disclosureButton: UIButton = { let button = NonIntrinsicButton() button.tintColor = UIColor.tertiaryLabel button.setImage(AppAssets.disclosureImage, for: .normal) button.contentMode = .center if #available(iOS 13.4, *) { - button.addInteraction(UIPointerInteraction()) + button.addInteraction(disclosurePointerInteraction) } button.addTarget(self, action: #selector(toggleDisclosure), for: .touchUpInside) return button