Skip to content

Commit

Permalink
Get scale factor for view from trait collection instead of screen
Browse files Browse the repository at this point in the history
  • Loading branch information
NickEntin committed Apr 16, 2024
1 parent ce04c4d commit 6324d72
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Paralayout/PixelRounding.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ extension UIScreen: ScaleFactorProviding {
extension UIView: ScaleFactorProviding {

public var pixelsPerPoint: CGFloat {
return (window?.screen ?? UIScreen.main).pixelsPerPoint
return traitCollection.displayScale
}

}
Expand Down

0 comments on commit 6324d72

Please sign in to comment.