Allow long-press reblur on images

This commit is contained in:
jack
2025-10-14 22:21:17 +02:00
parent 9e0542df73
commit 567e1dbbbf
@@ -106,6 +106,7 @@ struct BlockRevealImageView: View {
loadImage() loadImage()
} }
.gesture(gestureHandler) .gesture(gestureHandler)
.simultaneousGesture(longPressGesture)
} }
private func loadImage() { private func loadImage() {
@@ -140,6 +141,17 @@ struct BlockRevealImageView: View {
} }
return doubleTap.exclusively(before: singleTap) return doubleTap.exclusively(before: singleTap)
} }
private var longPressGesture: some Gesture {
LongPressGesture(minimumDuration: 0.4).onEnded { _ in
guard !isSending else { return }
if !isBlurred {
withAnimation(.easeInOut(duration: 0.2)) {
isBlurred = true
}
}
}
}
} }
private struct BlockRevealMask: Shape { private struct BlockRevealMask: Shape {