diff --git a/Sources/IsScrolling/IsScrolling.swift b/Sources/IsScrolling/IsScrolling.swift index 29abbac..1659b01 100644 --- a/Sources/IsScrolling/IsScrolling.swift +++ b/Sources/IsScrolling/IsScrolling.swift @@ -28,7 +28,7 @@ public extension View { Color.clear .preference( key: MinValueKey.self, - value: .init(x: proxy.frame(in: .global).minX, y: proxy.frame(in: .global).minY) + value: proxy.frame(in: .global) ) } ) diff --git a/Sources/IsScrolling/Key.swift b/Sources/IsScrolling/Key.swift index d1eb1bf..47f2f53 100644 --- a/Sources/IsScrolling/Key.swift +++ b/Sources/IsScrolling/Key.swift @@ -20,8 +20,8 @@ public extension EnvironmentValues { } public struct MinValueKey: PreferenceKey { - public static var defaultValue: CGPoint = .zero - public static func reduce(value: inout CGPoint, nextValue: () -> CGPoint) { + public static var defaultValue: CGRect = .zero + public static func reduce(value: inout CGRect, nextValue: () -> CGRect) { value = nextValue() } }