From e8f2e8382c9ffcfa362c33845a5cdac7eb5739de Mon Sep 17 00:00:00 2001 From: Nicholas Entin Date: Fri, 26 Jan 2024 22:37:50 -0800 Subject: [PATCH] Get scale factor for view from trait collection instead of screen --- Paralayout/PixelRounding.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Paralayout/PixelRounding.swift b/Paralayout/PixelRounding.swift index 876b9c2..2c9d3e5 100644 --- a/Paralayout/PixelRounding.swift +++ b/Paralayout/PixelRounding.swift @@ -34,7 +34,7 @@ extension UIScreen: ScaleFactorProviding { extension UIView: ScaleFactorProviding { public var pixelsPerPoint: CGFloat { - return (window?.screen ?? UIScreen.main).pixelsPerPoint + return traitCollection.displayScale } }