From a90e5ed73de163d4a7cd5885aefdd250f84acbc8 Mon Sep 17 00:00:00 2001 From: "Li, Zhen" Date: Tue, 20 Feb 2024 21:28:50 -0500 Subject: [PATCH] Fix issue-43: Dragging nodes does not work on iOS --- Sources/Grape/Views/ForceDirectedGraph+View.swift | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Sources/Grape/Views/ForceDirectedGraph+View.swift b/Sources/Grape/Views/ForceDirectedGraph+View.swift index b19520a..69d935f 100644 --- a/Sources/Grape/Views/ForceDirectedGraph+View.swift +++ b/Sources/Grape/Views/ForceDirectedGraph+View.swift @@ -80,13 +80,6 @@ extension ForceDirectedGraph: View { let _ = model.currentFrame self.model.render(&context, size) } -#if os(iOS) || os(macOS) - .gesture( - MagnifyGesture(minimumScaleDelta: Self.minimumScaleDelta) - .onChanged(onMagnifyChange) - .onEnded(onMagnifyEnd) - ) -#endif #if !os(tvOS) .gesture( DragGesture( @@ -98,6 +91,14 @@ extension ForceDirectedGraph: View { ) .onTapGesture(count: 1, perform: onTapGesture) #endif + +#if os(iOS) || os(macOS) + .gesture( + MagnifyGesture(minimumScaleDelta: Self.minimumScaleDelta) + .onChanged(onMagnifyChange) + .onEnded(onMagnifyEnd) + ) +#endif } }