File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -128,6 +128,7 @@ struct PanelView: View {
128128 @SceneStorage ( " panel.height " ) var panelHeight : Double = DefaultUIState . PANEL_HEIGHT
129129
130130 @State var showSheet = false
131+ @GestureState private var translation : CGFloat ?
131132
132133 var maxHeight : CGFloat {
133134 windowHeight
@@ -155,10 +156,12 @@ struct PanelView: View {
155156 . frame ( height: min ( CGFloat ( panelHeight) , maxHeight) )
156157 . background ( Color . init ( id: " editor.background " ) )
157158 . gesture (
158- DragGesture ( )
159- . onChanged { value in
160- let proposedNewHeight = panelHeight - value. translation. height
159+ DragGesture ( minimumDistance: 10.0 , coordinateSpace: . global)
160+ . updating ( $translation) { value, gestureState, transaction in
161+ let proposedNewHeight =
162+ panelHeight - value. translation. height + ( gestureState ?? 0 )
161163 evaluateProposedHeight ( proposal: proposedNewHeight)
164+ gestureState = value. translation. height
162165 }
163166 )
164167 }
You can’t perform that action at this time.
0 commit comments