Skip to content

Commit

Permalink
update PreferenceKey
Browse files Browse the repository at this point in the history
  • Loading branch information
fatbobman committed Sep 12, 2022
1 parent 84b6df5 commit ff37d28
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Sources/IsScrolling/IsScrolling.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)
}
)
Expand Down
4 changes: 2 additions & 2 deletions Sources/IsScrolling/Key.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
Expand Down

0 comments on commit ff37d28

Please sign in to comment.