Skip to content

Commit

Permalink
Try more granular cases for geomchange
Browse files Browse the repository at this point in the history
  • Loading branch information
eonist committed Oct 23, 2024
1 parent 4a161f0 commit b0cd656
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"location" : "https://github.com/sentryco/SplitViewKit",
"state" : {
"branch" : "main",
"revision" : "f8e2fae61676720ee9912b94eb43cea358d43dfd"
"revision" : "4a161f02bf0b47de844777f07ea7527fb1db0d87"
}
}
],
Expand Down
12 changes: 6 additions & 6 deletions Sources/SplitViewKit/util/GeometryChange.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import SwiftUI
// - Fixme: ⚠️️ we might have to account for all cases, lets see if reordering the cases works first
func geometryChange(isLandscape: Bool, sizeClass: UserInterfaceSizeClass?, winWidth: CGFloat, closure: (_ winWidth: CGFloat) -> some View) -> some View {
switch true {
case /*columnWidth.*/isNarrow(isLandscape: isLandscape, winWidth: winWidth):
Swift.print("👉 isNarrow")
case isLandscape, sizeClass == .compact:
Swift.print("👉 isLandscape, compact")
return closure(winWidth)
case sizeClass == .compact:
Swift.print("👉 compact")
case isLandscape, sizeClass == .regular, isNarrow(isLandscape: isLandscape, winWidth: winWidth):
Swift.print("👉 isLandscape, regular, isNarrow")
return closure(winWidth)
case isLandscape:
Swift.print("👉 isLandscape")
case isLandscape, sizeClass == .regular, !isNarrow(isLandscape: isLandscape, winWidth: winWidth):
Swift.print("👉 isLandscape, regular, fullscreen")
return closure(winWidth)
default:
Swift.print("👉 default")
Expand Down

0 comments on commit b0cd656

Please sign in to comment.