Skip to content

Commit a60afbe

Browse files
committed
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.
1 parent 8eaa3a1 commit a60afbe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/Impl/Coordinates.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ final class Coordinates<PinView: Layoutable> {
109109
private func getDisplayScale() -> CGFloat {
110110
#if os(iOS) || os(tvOS)
111111
if #available(iOS 13.0, tvOS 13.0, *) {
112-
return UITraitCollection.current.displayScale
112+
return max(UITraitCollection.current.displayScale, 1)
113113
} else {
114114
return UIScreen.main.scale
115115
}

0 commit comments

Comments
 (0)