Skip to content

Commit f2bf23d

Browse files
committed
Align iOS portrait layout editor with gameplay
1 parent daebb8a commit f2bf23d

1 file changed

Lines changed: 12 additions & 9 deletions

File tree

app/src/main/swift/Views/Settings/PadLayoutEditView.swift

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ struct PadLayoutEditView: View {
2525
let isActuallyLandscape = geo.size.width > geo.size.height
2626
ZStack {
2727
if isActuallyLandscape {
28-
landscapeEditorCanvas(width: geo.size.width, height: geo.size.height)
28+
landscapeEditorCanvas()
2929
} else {
3030
portraitEditorCanvas(width: geo.size.width, height: geo.size.height)
3131
}
@@ -60,7 +60,6 @@ struct PadLayoutEditView: View {
6060
.padding(.top, 50)
6161
}
6262
}
63-
.ignoresSafeArea()
6463
.navigationBarHidden(true)
6564
.statusBarHidden()
6665
.persistentSystemOverlays(.hidden)
@@ -78,16 +77,20 @@ struct PadLayoutEditView: View {
7877
}
7978

8079
// MARK: - Landscape editor canvas (always shown when device is landscape)
81-
private func landscapeEditorCanvas(width: CGFloat, height: CGFloat) -> some View {
82-
ZStack {
83-
Color.clear
84-
.allowsHitTesting(false)
80+
private func landscapeEditorCanvas() -> some View {
81+
GeometryReader { geo in
82+
let width = geo.size.width
83+
let height = geo.size.height
84+
ZStack {
85+
Color.clear
86+
.allowsHitTesting(false)
8587

86-
customSkinPreview(isLandscape: true, width: width, height: height)
88+
customSkinPreview(isLandscape: true, width: width, height: height)
8789

88-
editorContent(areaW: width, areaH: height)
90+
editorContent(areaW: width, areaH: height)
91+
}
92+
.contentShape(Rectangle())
8993
}
90-
.contentShape(Rectangle())
9194
.ignoresSafeArea()
9295
}
9396

0 commit comments

Comments
 (0)