commit 7263ae381f48c3cd1e601db57ae8a813b9f45baf
parent 7feb9d2759fe22b32fb412c106b63fdc58ed51f0
Author: Michael Camilleri <[email protected]>
Date: Wed, 6 May 2026 22:56:05 +0900
Change swipe gesture to change cursor axis to tap gesture
Diffstat:
2 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/Crossmate/Views/KeyboardView.swift b/Crossmate/Views/KeyboardView.swift
@@ -123,15 +123,6 @@ struct KeyboardView: View {
.padding(.horizontal, 4)
.padding(.top, 12)
.padding(.bottom, 8)
- .simultaneousGesture(
- DragGesture(minimumDistance: 20)
- .onEnded { value in
- let dx = value.translation.width
- let dy = value.translation.height
- guard dx * dx + dy * dy >= 400 else { return }
- session.setDirection(abs(dx) >= abs(dy) ? .across : .down)
- }
- )
}
private func letterKey(_ letter: String) -> some View {
diff --git a/Crossmate/Views/PuzzleView.swift b/Crossmate/Views/PuzzleView.swift
@@ -937,6 +937,7 @@ private struct ClueBarContent: View {
var onPrevious: (() -> Void)?
var onNext: (() -> Void)?
var onClueTap: (() -> Void)?
+ var onLabelTap: (() -> Void)?
var body: some View {
HStack(alignment: .clueCenter, spacing: 12) {
@@ -947,6 +948,13 @@ private struct ClueBarContent: View {
.font(.caption)
.textCase(.uppercase)
.foregroundStyle(.secondary)
+ .contentShape(Rectangle())
+ .highPriorityGesture(
+ TapGesture()
+ .onEnded {
+ onLabelTap?()
+ }
+ )
ZStack(alignment: .leading) {
clueTextView
}
@@ -1033,6 +1041,9 @@ private struct ClueBar: View {
},
onClueTap: {
isShowingClueList = true
+ },
+ onLabelTap: {
+ session.toggleDirection()
}
)
.background(playerColor.highlightFill)