Skip to content
Merged
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Sources/Public/iOS/LottieAnimationViewBase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ open class LottieAnimationViewBase: UIView {

var screenScale: CGFloat {
#if os(iOS) || os(tvOS)
UIScreen.main.scale
if #available(iOS 13.0, tvOS 13.0, *) {
return UITraitCollection.current.displayScale
} else {
return UIScreen.main.scale
}
#else // if os(visionOS)
// We intentionally don't check `#if os(visionOS)`, because that emits
// a warning when building on Xcode 14 and earlier.
Expand Down Expand Up @@ -79,6 +83,5 @@ open class LottieAnimationViewBase: UIView {
func animationWillEnterForeground() {
// Implemented by subclasses.
}

}
#endif