From a60afbeb904902c06d617f2ef01920b1beacb8a1 Mon Sep 17 00:00:00 2001 From: Elon Park Date: Fri, 12 Jan 2024 12:26:54 +0900 Subject: [PATCH] fix: fix getDisplayScale - The default display scale for a trait collection is 0.0 (indicating unspecified). - But, UIScreen.scale is for standard-resolution displays(none retina displays), the scale factor is 1.0 and one point equals one pixel. --- Sources/Impl/Coordinates.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Impl/Coordinates.swift b/Sources/Impl/Coordinates.swift index 2d22563..c1f0c56 100644 --- a/Sources/Impl/Coordinates.swift +++ b/Sources/Impl/Coordinates.swift @@ -109,7 +109,7 @@ final class Coordinates { private func getDisplayScale() -> CGFloat { #if os(iOS) || os(tvOS) if #available(iOS 13.0, tvOS 13.0, *) { - return UITraitCollection.current.displayScale + return max(UITraitCollection.current.displayScale, 1) } else { return UIScreen.main.scale }