File tree Expand file tree Collapse file tree 1 file changed +15
-12
lines changed
Sources/ComponentsKit/Components/Card Expand file tree Collapse file tree 1 file changed +15
-12
lines changed Original file line number Diff line number Diff line change @@ -51,27 +51,30 @@ public struct SUCard<Content: View>: View {
5151 . cornerRadius ( self . model. cornerRadius. value)
5252 . overlay (
5353 RoundedRectangle ( cornerRadius: self . model. cornerRadius. value)
54- . stroke (
54+ . strokeBorder (
5555 self . model. borderColor. color,
5656 lineWidth: self . model. borderWidth. value
5757 )
5858 )
5959 . shadow ( self . model. shadow)
6060 . observeSize { self . contentSize = $0 }
61- . simultaneousGesture ( DragGesture ( minimumDistance: 0.0 )
62- . onChanged { _ in
63- guard self . model. isTappable else { return }
64- self . isPressed = true
65- }
66- . onEnded { value in
67- guard self . model. isTappable else { return }
61+ . contentShape ( . rect)
62+ . gesture (
63+ DragGesture ( minimumDistance: 0.0 )
64+ . onChanged { _ in
65+ guard self . model. isTappable else { return }
66+ self . isPressed = true
67+ }
68+ . onEnded { value in
69+ guard self . model. isTappable else { return }
6870
69- defer { self . isPressed = false }
71+ defer { self . isPressed = false }
7072
71- if CGRect ( origin: . zero, size: self . contentSize) . contains ( value. location) {
72- self . onTap ( )
73+ if CGRect ( origin: . zero, size: self . contentSize)
74+ . contains ( value. location) {
75+ self . onTap ( )
76+ }
7377 }
74- }
7578 )
7679 . scaleEffect (
7780 self . isPressed ? self . model. animationScale. value : 1 ,
You can’t perform that action at this time.
0 commit comments