Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undocumented bahavior of layers in partitions #4

Open
shengchl opened this issue Nov 29, 2019 · 0 comments
Open

undocumented bahavior of layers in partitions #4

shengchl opened this issue Nov 29, 2019 · 0 comments

Comments

@shengchl
Copy link

Hey there,

I am playing with the DragGesture in VPart and encountered in undefined behavior of partition layers. For example, when I drag a rectangle from the top partition to the bottom one using offset, it appears beneath the bottom's partition rectangle. I am looking for the way to implement the opposite behavior but as of now I cannot understand what influences it.

here's the example VPart:
@GestureState var isLongPressed = false
@State private var offset: CGSize = .zero
var body: some View {

  VPart(top: {
       HStack {

            Rectangle()
            .fill(Color.green)
            .cornerRadius(10)
            .frame(minWidth: 20, maxWidth: 200, minHeight: 20, maxHeight: 200)
            .offset(offset)
            .gesture(DragGesture()
            .onChanged { self.offset = $0.translation }
            .onEnded { _ in self.offset = .zero }
            )`
        }
        }, bottom: {
        Rectangle()
            .fill(Color.red)
            .cornerRadius(10)
            .frame(minWidth: 20, maxWidth: 200, minHeight: 20, maxHeight: 200)
        })
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant